Ejemplo n.º 1
0
def delete_deployment_plan(workflow_client, **input_):
    try:
        results = base.call_action(workflow_client, 'tripleo.plan.delete',
                                   **input_)
        if results is not None:
            print(results)
    except Exception as err:
        raise exceptions.WorkflowServiceError(
            'Exception deleting plan: {}'.format(err))
Ejemplo n.º 2
0
    def test_call_action_success(self):
        mistral = mock.Mock()
        action = 'test-action'

        result = mock.Mock()
        result.output = '{"result":"test-result"}'
        mistral.action_executions.create = mock.Mock(return_value=result)

        self.assertEqual(base.call_action(mistral, action), "test-result")
def delete_deployment_plan(workflow_client, **input_):
    try:
        results = base.call_action(workflow_client,
                                   'tripleo.plan.delete',
                                   **input_)
        if results is not None:
            print(results)
    except Exception as err:
        raise exceptions.WorkflowServiceError(
            'Exception deleting plan: {}'.format(err))
Ejemplo n.º 4
0
def get_deployment_failures(clients, **workflow_input):
    workflow_client = clients.workflow_engine

    result = base.call_action(workflow_client,
                              'tripleo.deployment.get_deployment_failures',
                              **workflow_input)

    message = result.get('message')
    if message:
        print(message)

    return result['failures']
    def take_action(self, parsed_args):
        nodes_config = utils.parse_env_file(parsed_args.instackenv)

        # We only need to collect OpenStack client authentication data
        # if we have nodes using Ironic's pxe_ssh driver. If there are
        # any, we'll use the fence_ironic fencing agent, which requires
        # the auth data.
        os_auth = None
        for node in nodes_config:
            if node["pm_type"] == "pxe_ssh":
                os_auth = {}
        if os_auth:
            try:
                os_auth["auth_url"] = os.environ["OS_AUTH_URL"]
                os_auth["login"] = os.environ["OS_USERNAME"]
                os_auth["passwd"] = os.environ["OS_PASSWORD"]
                os_auth["tenant_name"] = os.environ["OS_TENANT_NAME"]
            except KeyError:
                # This really shouldn't happen since we're running in
                # tripleoclient
                raise ValueError(
                    _("Unable to find one or more of OS_AUTH_URL, "
                      "OS_USERNAME, OS_PASSWORD or OS_TENANT_NAME in the "
                      "environment."))
        workflow_input = {
            'nodes_json': nodes_config,
            'os_auth': os_auth,
            'fence_action': parsed_args.fence_action,
            'delay': parsed_args.delay,
            'ipmi_level': parsed_args.ipmi_level,
            'ipmi_cipher': parsed_args.ipmi_cipher,
            'ipmi_lanplus': parsed_args.ipmi_lanplus,
            }
        result = base.call_action(
            self.app.client_manager.workflow_engine,
            'tripleo.parameters.generate_fencing',
            **workflow_input)
        fencing_parameters = yaml.safe_dump(result, default_flow_style=False)
        if parsed_args.output:
            parsed_args.output.write(fencing_parameters)
        else:
            print(fencing_parameters)
def create_container(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.plan.create_container',
                            **input_)
Ejemplo n.º 7
0
def update_parameters(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.parameters.update',
                            **input_)
Ejemplo n.º 8
0
def overcloudrc(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.deployment.overcloudrc',
                            **input_)
Ejemplo n.º 9
0
def process_templates(workflow_client, **workflow_input):
    return base.call_action(workflow_client, 'tripleo.templates.process',
                            **workflow_input)
def list_deployment_plans(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.plan.list', **input_)
Ejemplo n.º 11
0
def reset_parameters(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.parameters.reset',
                            **input_)
Ejemplo n.º 12
0
def reset_parameters(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.parameters.reset',
                            **input_)
Ejemplo n.º 13
0
def update_parameters(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.parameters.update',
                            **input_)
Ejemplo n.º 14
0
def list_roles(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.role.list', **input_)
def create_container(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.plan.create_container',
                            **input_)
def list_deployment_plans(workflow_client, **input_):
    return base.call_action(workflow_client, 'tripleo.plan.list', **input_)