81
81
res = self.session.get(url, headers=headers)
82
82
return res.json()['commands']
84
def deploy_is_done(self, node):
85
commands = self.get_commands_status(node)
89
last_command = commands[-1]
91
if last_command['command_name'] != 'prepare_image':
92
# catches race condition where prepare_image is still processing
93
# so deploy hasn't started yet
96
if last_command['command_status'] != 'RUNNING':
101
84
def prepare_image(self, node, image_info, wait=False):
102
85
"""Call the `prepare_image` method on the node."""
103
86
LOG.debug('Preparing image %(image)s on node %(node)s.',
114
97
method='standby.prepare_image',
101
def start_iscsi_target(self, node, iqn):
102
"""Expose the node's disk as an ISCSI target."""
103
params = {'iqn': iqn}
104
return self._command(node=node,
105
method='iscsi.start_iscsi_target',
109
def install_bootloader(self, node, root_uuid, efi_system_part_uuid=None):
110
"""Install a boot loader on the image."""
111
params = {'root_uuid': root_uuid,
112
'efi_system_part_uuid': efi_system_part_uuid}
113
return self._command(node=node,
114
method='image.install_bootloader',
118
def get_clean_steps(self, node, ports):
120
'node': node.as_dict(),
121
'ports': [port.as_dict() for port in ports]
123
return self._command(node=node,
124
method='clean.get_clean_steps',
128
def execute_clean_step(self, step, node, ports):
131
'node': node.as_dict(),
132
'ports': [port.as_dict() for port in ports],
133
'clean_version': node.driver_internal_info.get(
134
'hardware_manager_version')
136
return self._command(node=node,
137
method='clean.execute_clean_step',