def test(self, mock_v1): mock_v1.return_value.get_status.return_value = 'json' self.assertEqual('json', client.get_status(self.uuid, auth_token=self.token)) mock_v1.assert_called_once_with(auth_token=self.token, inspector_url=None, api_version=client.DEFAULT_API_VERSION) mock_v1.return_value.get_status.assert_called_once_with(self.uuid)
def test(self, mock_v1): mock_v1.return_value.get_status.return_value = 'json' self.assertEqual('json', client.get_status(self.uuid, session=self.session)) mock_v1.assert_called_once_with(auth_token=None, session=self.session, inspector_url=None, api_version=client.DEFAULT_API_VERSION) mock_v1.return_value.get_status.assert_called_once_with(self.uuid)
def take_action(self, parsed_args): self.log.debug("take_action(%s)" % parsed_args) client = self.app.client_manager.tripleoclient.baremetal() auth_token = self.app.client_manager.auth_ref.auth_token statuses = [] for node in client.node.list(): self.log.debug("Getting introspection status of Ironic node {0}" .format(node.uuid)) statuses.append((node.uuid, inspector_client.get_status( node.uuid, base_url=parsed_args.inspector_url, auth_token=auth_token))) return ( ("Node UUID", "Finished", "Error"), list((node_uuid, status['finished'], status['error']) for (node_uuid, status) in statuses) )
def take_action(self, parsed_args): self.log.debug("take_action(%s)" % parsed_args) client = self.app.client_manager.tripleoclient.baremetal auth_token = self.app.client_manager.auth_ref.auth_token statuses = [] for node in client.node.list(): self.log.debug( "Getting introspection status of Ironic node {0}".format( node.uuid)) statuses.append((node.uuid, inspector_client.get_status( node.uuid, base_url=parsed_args.inspector_url, auth_token=auth_token))) return (("Node UUID", "Finished", "Error"), list((node_uuid, status['finished'], status['error']) for (node_uuid, status) in statuses))