def _plan_delete(self, workflow_client, stack_name):
     print("Deleting plan {s}...".format(s=stack_name))
     try:
         plan_management.delete_deployment_plan(workflow_client,
                                                container=stack_name)
     except Exception as err:
         raise oscexc.CommandError(
             "Error occurred while deleting plan {}".format(err))
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)

        clients = self.app.client_manager

        for plan in parsed_args.plans:
            print("Deleting plan %s..." % plan)
            plan_management.delete_deployment_plan(clients, container=plan)
 def _plan_delete(self, workflow_client, stack_name):
     print("Deleting plan {s}...".format(s=stack_name))
     try:
         plan_management.delete_deployment_plan(
             workflow_client,
             container=stack_name)
     except Exception as err:
         raise oscexc.CommandError(
             "Error occurred while deleting plan {}".format(err))
Ejemplo n.º 4
0
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)

        workflow_client = self.app.client_manager.workflow_engine

        for plan in parsed_args.plans:
            print("Deleting plan %s..." % plan)
            plan_management.delete_deployment_plan(workflow_client,
                                                   container=plan)
    def test_delete_plan(self):
        output = mock.Mock(output='{"result": ""}')
        self.workflow.action_executions.create.return_value = output
        self.websocket.wait_for_messages.return_value = self.message_success

        plan_management.delete_deployment_plan(self.app.client_manager,
                                               container='test-overcloud')

        self.workflow.executions.create.assert_called_once_with(
            'tripleo.plan_management.v1.delete_deployment_plan',
            workflow_input={'container': 'test-overcloud'})
    def test_delete_plan(self):
        self.workflow.action_executions.create.return_value = (mock.Mock(
            output='{"result": null}'))

        plan_management.delete_deployment_plan(self.workflow,
                                               container='overcloud')

        self.workflow.action_executions.create.assert_called_once_with(
            'tripleo.plan.delete', {'container': 'overcloud'},
            run_sync=True,
            save_result=True)
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)

        workflow_client = self.app.client_manager.workflow_engine

        for plan in parsed_args.plans:
            print("Deleting plan %s..." % plan)
            try:
                plan_management.delete_deployment_plan(workflow_client,
                                                       container=plan)
            except Exception:
                self.log.exception("Error deleting plan")
    def test_delete_plan(self):
        self.workflow.action_executions.create.return_value = (
            mock.Mock(output='{"result": null}'))

        plan_management.delete_deployment_plan(
            self.workflow,
            container='overcloud')

        self.workflow.action_executions.create.assert_called_once_with(
            'tripleo.plan.delete',
            {'container': 'overcloud'},
            run_sync=True, save_result=True)