def get_patch_status(self, cluster, env): from_ami = self.opts.get('from-ami') to_ami = self.opts.get('to-ami') whitelist = self.get_user_filter('whitelist', 'match') blacklist = self.get_user_filter('blacklist', 'ignore') result = self.get_patch_requirements(cluster, env, from_ami, to_ami, whitelist, blacklist) if not result: self.patch_not_required(cluster, env) else: message = PatchOperation.describe_patches(result) self.show_result(result, message)
def confirm_patch(self, patches): to_patch = PatchOperation.get_patches_by_availability(patches, True) to_ignore = PatchOperation.get_patches_by_availability(patches, False) to_ignore += [{ 'server_name': server, 'invalid_ami': True } for server in self.ignored_servers] message = PatchOperation.describe_patches(to_patch, to_ignore) if not to_patch: self.show_result({}, message) return False else: message.append('Do you want to continue? (y/n) ') return confirm(message)