예제 #1
0
    def take_action(self, parsed_args):

        self.log.debug("take_action(%s)" % parsed_args)
        self.log.warning('This command is deprecated. Please use "openstack '
                         'overcloud node introspect" to introspect manageable '
                         'nodes instead.\n')

        queue_name = str(uuid.uuid4())
        clients = self.app.client_manager
        client = self.app.client_manager.baremetal

        # TODO(d0ugal): We don't yet have a workflow to move from available
        # or enroll to manageable. Once we do, this should be switched over.
        print("Setting nodes for introspection to manageable...")
        self.log.debug("Moving available/enroll nodes to manageable state.")
        available_nodes = utils.nodes_in_states(client, ("available",
                                                         "enroll"))
        for node_uuid in utils.set_nodes_state(client, available_nodes,
                                               'manage', 'manageable'):
            self.log.debug(
                "Node {0} has been set to manageable.".format(node_uuid))

        print("Starting introspection of manageable nodes")
        baremetal.introspect_manageable_nodes(clients, queue_name=queue_name)

        print("Setting manageable nodes to available...")
        self.log.debug("Moving manageable nodes to available state.")

        baremetal.provide_manageable_nodes(clients, queue_name=queue_name)
    def take_action(self, parsed_args):

        self.log.debug("take_action(%s)" % parsed_args)
        self.log.warning('This command is deprecated. Please use "openstack '
                         'overcloud node introspect" to introspect manageable '
                         'nodes instead.\n')

        queue_name = str(uuid.uuid4())
        clients = self.app.client_manager
        client = self.app.client_manager.baremetal

        # TODO(d0ugal): We don't yet have a workflow to move from available
        # or enroll to manageable. Once we do, this should be switched over.
        print("Setting nodes for introspection to manageable...")
        self.log.debug("Moving available/enroll nodes to manageable state.")
        available_nodes = utils.nodes_in_states(client,
                                                ("available", "enroll"))
        for node_uuid in utils.set_nodes_state(client, available_nodes,
                                               'manage', 'manageable'):
            self.log.debug(
                "Node {0} has been set to manageable.".format(node_uuid))

        print("Starting introspection of manageable nodes")
        baremetal.introspect_manageable_nodes(clients, queue_name=queue_name)

        print("Setting manageable nodes to available...")
        self.log.debug("Moving manageable nodes to available state.")

        baremetal.provide_manageable_nodes(clients, queue_name=queue_name)
예제 #3
0
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)

        if parsed_args.all_manageable:
            baremetal.introspect_manageable_nodes(
                self.app.client_manager,
                run_validations=parsed_args.run_validations,
                concurrency=parsed_args.concurrency,
                verbosity=oooutils.playbook_verbosity(self=self)
            )
        else:
            baremetal.introspect(
                self.app.client_manager,
                node_uuids=parsed_args.node_uuids,
                run_validations=parsed_args.run_validations,
                concurrency=parsed_args.concurrency,
                verbosity=oooutils.playbook_verbosity(self=self)
            )

        # NOTE(cloudnull): This is using the old provide function, in a future
        #                  release this may be ported to a standalone playbook
        if parsed_args.provide:
            if parsed_args.node_uuids:
                baremetal.provide(
                    self.app.client_manager,
                    node_uuids=parsed_args.node_uuids,
                )
            else:
                baremetal.provide_manageable_nodes(
                    clients=self.app.client_manager,
                    verbosity=oooutils.playbook_verbosity(self=self)
                )
    def test_introspect_manageable_nodes_success(self):

        self.websocket.wait_for_message.return_value = {
            "status": "SUCCESS",
            "introspected_nodes": {},
        }

        baremetal.introspect_manageable_nodes(self.app.client_manager,
                                              queue_name="QUEUE_NAME")

        self.workflow.executions.create.assert_called_once_with(
            'tripleo.baremetal.v1.introspect_manageable_nodes',
            workflow_input={'queue_name': "QUEUE_NAME"})
    def test_introspect_manageable_nodes_success(self):

        self.websocket.wait_for_message.return_value = {
            "status": "SUCCESS",
            "introspected_nodes": {},
        }

        baremetal.introspect_manageable_nodes(
            self.app.client_manager, queue_name="QUEUE_NAME")

        self.workflow.executions.create.assert_called_once_with(
            'tripleo.baremetal.v1.introspect_manageable_nodes',
            workflow_input={'queue_name': "QUEUE_NAME"})
예제 #6
0
    def test_introspect_manageable_nodes_success(self):

        self.websocket.wait_for_messages.return_value = iter([{
            "execution": {
                "id": "IDID"
            },
            "status": "SUCCESS",
            "introspected_nodes": {},
        }])

        baremetal.introspect_manageable_nodes(self.app.client_manager,
                                              run_validations=False)
        self.workflow.executions.create.assert_called_once_with(
            'tripleo.baremetal.v1.introspect_manageable_nodes',
            workflow_input={
                'run_validations': False,
            })
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)

        queue_name = str(uuid.uuid4())
        nodes = parsed_args.node_uuids

        if nodes:
            baremetal.introspect(self.app.client_manager,
                                 node_uuids=nodes,
                                 queue_name=queue_name)
        else:
            baremetal.introspect_manageable_nodes(self.app.client_manager,
                                                  queue_name=queue_name)

        if parsed_args.provide:
            if nodes:
                baremetal.provide(self.app.client_manager,
                                  node_uuids=nodes,
                                  queue_name=queue_name)
            else:
                baremetal.provide_manageable_nodes(self.app.client_manager,
                                                   queue_name=queue_name)
예제 #8
0
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)

        nodes = parsed_args.node_uuids

        if nodes:
            baremetal.introspect(self.app.client_manager,
                                 node_uuids=nodes,
                                 run_validations=parsed_args.run_validations)
        else:
            baremetal.introspect_manageable_nodes(
                self.app.client_manager,
                run_validations=parsed_args.run_validations)

        if parsed_args.provide:
            if nodes:
                baremetal.provide(
                    self.app.client_manager,
                    node_uuids=nodes,
                )
            else:
                baremetal.provide_manageable_nodes(self.app.client_manager)
    def take_action(self, parsed_args):
        self.log.debug("take_action(%s)" % parsed_args)

        queue_name = str(uuid.uuid4())
        nodes = parsed_args.node_uuids

        if nodes:
            baremetal.introspect(self.app.client_manager,
                                 node_uuids=nodes,
                                 queue_name=queue_name)
        else:
            baremetal.introspect_manageable_nodes(self.app.client_manager,
                                                  queue_name=queue_name)

        if parsed_args.provide:
            if nodes:
                baremetal.provide(self.app.client_manager,
                                  node_uuids=nodes,
                                  queue_name=queue_name)
            else:
                baremetal.provide_manageable_nodes(self.app.client_manager,
                                                   queue_name=queue_name)
예제 #10
0
 def test_introspect_manageable_nodes_success(self):
     baremetal.introspect_manageable_nodes(self.app.client_manager,
                                           run_validations=False,
                                           concurrency=20)