From 879d73c5a4c4fda99412a16229931ab91232796d Mon Sep 17 00:00:00 2001 From: "Brad P. Crochet" Date: Thu, 23 Mar 2017 13:18:04 -0400 Subject: [PATCH] Remove update abort The update abort is not reliable, and could mess up a TripleO stack beyond repair. Since this has a potential for data loss, I would suggest this be removed without a deprecation period. Change-Id: Ieec4f01e38768eafb3df1f06340bdd3e220d30bd Related-Bug: #1668269 (cherry picked from commit 1d3231de5a74d5ddf89cd96ccb598e2293a36b2f) --- .../notes/remove-abort-9aa90d73d09507c9.yaml | 8 +++++ setup.cfg | 1 - tripleoclient/v1/overcloud_update.py | 29 ------------------- tripleoclient/workflows/package_update.py | 18 ------------ 4 files changed, 8 insertions(+), 48 deletions(-) create mode 100644 releasenotes/notes/remove-abort-9aa90d73d09507c9.yaml diff --git a/releasenotes/notes/remove-abort-9aa90d73d09507c9.yaml b/releasenotes/notes/remove-abort-9aa90d73d09507c9.yaml new file mode 100644 index 000000000..9e125b6f2 --- /dev/null +++ b/releasenotes/notes/remove-abort-9aa90d73d09507c9.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - The update abort command was introduced many releases ago. However, it is + not a safe operation in the context of TripleO. The TripleO Heat stack + could become irrepairably damage should a rollback be attempted. As such, + it is best to remove this functionality without a deprecation period. + The workaround for this command is to wait until the stack times out or + completes the update. \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 9ddde8abb..e899a413d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -79,7 +79,6 @@ openstack.tripleoclient.v1 = overcloud_profiles_match = tripleoclient.v1.overcloud_profiles:MatchProfiles overcloud_profiles_list = tripleoclient.v1.overcloud_profiles:ListProfiles overcloud_raid_create = tripleoclient.v1.overcloud_raid:CreateRAID - overcloud_update_abort = tripleoclient.v1.overcloud_update:AbortUpdateOvercloud overcloud_update_clear_breakpoints = tripleoclient.v1.overcloud_update:ClearBreakpointsOvercloud overcloud_update_stack = tripleoclient.v1.overcloud_update:UpdateOvercloud overcloud_execute = tripleoclient.v1.overcloud_execute:RemoteExecute diff --git a/tripleoclient/v1/overcloud_update.py b/tripleoclient/v1/overcloud_update.py index 706b02874..707ba7cbd 100644 --- a/tripleoclient/v1/overcloud_update.py +++ b/tripleoclient/v1/overcloud_update.py @@ -47,10 +47,6 @@ class UpdateOvercloud(command.Command): ) parser.add_argument('-i', '--interactive', dest='interactive', action='store_true') - parser.add_argument('-a', '--abort', dest='abort_update', - action='store_true', - help=_('DEPRECATED. Please use the command' - '"openstack overcloud update abort"')) parser.add_argument( '-e', '--environment-file', metavar='', action='append', dest='environment_files', @@ -92,31 +88,6 @@ class UpdateOvercloud(command.Command): parsed_args.stack)) -class AbortUpdateOvercloud(command.Command): - """Aborts a package update on overcloud nodes""" - - log = logging.getLogger(__name__ + ".AbortUpdateOvercloud") - - def get_parser(self, prog_name): - parser = super(AbortUpdateOvercloud, self).get_parser(prog_name) - parser.add_argument('stack', nargs='?', - help=_('Name or ID of heat stack to abort a ' - 'running update ' - '(default=Env: OVERCLOUD_STACK_NAME)'), - default=utils.env('OVERCLOUD_STACK_NAME')) - return parser - - def take_action(self, parsed_args): - self.log.debug("take_action(%s)" % parsed_args) - clients = self.app.client_manager - - heat = clients.orchestration - - stack = oooutils.get_stack(heat, parsed_args.stack) - - package_update.abort_update(clients, stack_id=stack.id) - - class ClearBreakpointsOvercloud(command.Command): """Clears a set of breakpoints on a currently updating overcloud""" diff --git a/tripleoclient/workflows/package_update.py b/tripleoclient/workflows/package_update.py index 40d3f8c94..51db1fc45 100644 --- a/tripleoclient/workflows/package_update.py +++ b/tripleoclient/workflows/package_update.py @@ -67,24 +67,6 @@ def update_and_wait(log, clients, stack, plan_name, verbose_level, return stack.status -def abort_update(clients, **workflow_input): - - workflow_client = clients.workflow_engine - tripleoclients = clients.tripleoclient - workflow_input['queue_name'] = str(uuid.uuid4()) - queue_name = workflow_input['queue_name'] - - execution = base.start_workflow( - workflow_client, - 'tripleo.package_update.v1.cancel_stack_update', - workflow_input=workflow_input - ) - - with tripleoclients.messaging_websocket(queue_name) as ws: - message = ws.wait_for_message(execution.id) - assert message['status'] == "SUCCESS", pprint.pformat(message) - - def clear_breakpoints(clients, **workflow_input): workflow_client = clients.workflow_engine tripleoclients = clients.tripleoclient