def run_patch_update(self, cluster, env): env = env.lower() if self.environment_is_protected(env): self.stop_spinner() print('Bulk patching is temporarily disabled in {0}'.format(env)) return if self.opts.get('kill', False): self.stop_spinner() PatchOperation.kill(cluster, env) else: patch_operation = PatchOperation(self.api) current_operation = PatchOperation.get_current(cluster, env) if current_operation is None: 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') current_operation = self.get_patch_requirements( cluster, env, from_ami, to_ami, whitelist, blacklist) self.stop_spinner() if not current_operation: return self.patch_not_required(cluster, env) if not self.confirm_patch(current_operation): return else: print('') patch_operation.run(current_operation, cluster, env)
def show_current_status(self, cluster, env): patch_operation = PatchOperation.get_current(cluster, env) patch_status = PatchOperation.get_current_status(cluster, env) self.stop_spinner() self.show_result(patch_operation, patch_status)