Merge "register_all_nodes() now accepts keystoneclient"

This commit is contained in:
Jenkins 2014-11-21 10:54:05 +00:00 committed by Gerrit Code Review
commit 59cad9c27d
4 changed files with 6 additions and 5 deletions

View File

@ -71,7 +71,7 @@ def main():
nodes.register_all_nodes(
args.service_host, nodes_list, client=client, remove=args.remove,
blocking=True)
blocking=True, keystone_client=keystone_client)
except Exception:
logging.exception("Unexpected error during command execution")
return 1

View File

@ -46,7 +46,7 @@ class RegisterNodesTest(base.TestCase):
register_mock.assert_called_once_with(
"seed", {}, client='nova_bm_client_mock', remove=False,
blocking=True)
blocking=True, keystone_client='keystone_client_mock')
using_ironic_mock.assert_called_once_with(
keystone='keystone_client_mock')
get_keystone_client_mock.assert_called_once_with()
@ -76,7 +76,7 @@ class RegisterNodesTest(base.TestCase):
register_mock.assert_called_once_with(
"seed", {}, client='ironic_client_mock', remove=False,
blocking=True)
blocking=True, keystone_client='keystone_client_mock')
using_ironic_mock.assert_called_once_with(
keystone='keystone_client_mock')
get_keystone_client_mock.assert_called_once_with()

View File

@ -237,9 +237,9 @@ def _clean_up_extra_nodes(ironic_in_use, seen, client, remove=False):
def register_all_nodes(service_host, nodes_list, client=None, remove=False,
blocking=True):
blocking=True, keystone_client=None):
LOG.debug('Registering all nodes.')
ironic_in_use = using_ironic(keystone=None)
ironic_in_use = using_ironic(keystone=keystone_client)
if ironic_in_use:
if client is None:
LOG.warn('Creating ironic client inline is deprecated, please '

View File

@ -201,6 +201,7 @@ class NodesTest(base.TestCase):
port_call = mock.call(node_uuid=ironic.node.create.return_value.uuid,
address='aaa')
power_off_call = mock.call(ironic.node.create.return_value.uuid, 'off')
using_ironic.assert_called_once_with(keystone=None)
ironic.node.create.assert_has_calls([pxe_node, mock.ANY])
ironic.port.create.assert_has_calls([port_call])
ironic.node.set_power_state.assert_has_calls([power_off_call])