Merge "Return serialized node to the ramdisk"
This commit is contained in:
commit
472537d213
|
@ -201,7 +201,12 @@ Change Log
|
||||||
v1.0.0
|
v1.0.0
|
||||||
~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
* ``/v1/continue`` is now sync and errors are returned.
|
* ``/v1/continue`` is now sync:
|
||||||
|
|
||||||
|
* Errors are properly returned to the caller
|
||||||
|
* This call now returns value in form of ``{'node': <node dict>}`` on
|
||||||
|
success
|
||||||
|
|
||||||
* Option ``power_off_after_discovery`` controls whether to force power off
|
* Option ``power_off_after_discovery`` controls whether to force power off
|
||||||
after the successful discovery, and is ``False`` by default.
|
after the successful discovery, and is ``False`` by default.
|
||||||
* Discovery now times out by default.
|
* Discovery now times out by default.
|
||||||
|
|
|
@ -81,7 +81,8 @@ def process(node_info):
|
||||||
raise utils.DiscoveryFailed('Node %s is not on discovery' % uuid,
|
raise utils.DiscoveryFailed('Node %s is not on discovery' % uuid,
|
||||||
code=403)
|
code=403)
|
||||||
|
|
||||||
_process_node(ironic, node, node_info, valid_macs)
|
updated = _process_node(ironic, node, node_info, valid_macs)
|
||||||
|
return {'node': updated.to_dict()}
|
||||||
|
|
||||||
|
|
||||||
def _process_node(ironic, node, node_info, valid_macs):
|
def _process_node(ironic, node, node_info, valid_macs):
|
||||||
|
@ -133,7 +134,7 @@ def _process_node(ironic, node, node_info, valid_macs):
|
||||||
|
|
||||||
patch = [{'op': 'add', 'path': '/extra/newly_discovered', 'value': 'true'},
|
patch = [{'op': 'add', 'path': '/extra/newly_discovered', 'value': 'true'},
|
||||||
{'op': 'remove', 'path': '/extra/on_discovery'}]
|
{'op': 'remove', 'path': '/extra/on_discovery'}]
|
||||||
ironic.node.update(node.uuid, patch)
|
return ironic.node.update(node.uuid, patch)
|
||||||
|
|
||||||
|
|
||||||
def discover(uuids):
|
def discover(uuids):
|
||||||
|
|
|
@ -100,8 +100,11 @@ class TestProcess(BaseTest):
|
||||||
cli.node.get.return_value = self.node
|
cli.node.get.return_value = self.node
|
||||||
post_mock.return_value = (['fake patch', 'fake patch 2'],
|
post_mock.return_value = (['fake patch', 'fake patch 2'],
|
||||||
{'11:22:33:44:55:66': ['port patch']})
|
{'11:22:33:44:55:66': ['port patch']})
|
||||||
|
self.node.to_dict.return_value = self.data
|
||||||
|
cli.node.update.side_effect = [None, self.node]
|
||||||
|
|
||||||
discoverd.process(self.data)
|
res = discoverd.process(self.data)
|
||||||
|
self.assertEqual({'node': self.data}, res)
|
||||||
|
|
||||||
pop_mock.assert_called_once_with(**self.attributes)
|
pop_mock.assert_called_once_with(**self.attributes)
|
||||||
cli.node.get.assert_called_once_with(self.node.uuid)
|
cli.node.get.assert_called_once_with(self.node.uuid)
|
||||||
|
|
Loading…
Reference in New Issue