Merge "Allow introspection some time to start in ironic-inspector"
This commit is contained in:
commit
b463f1c682
|
@ -178,6 +178,9 @@ BaremetalIntrospectionGroup = [
|
|||
cfg.IntOpt('introspection_timeout',
|
||||
default=600,
|
||||
help="Introspection time out"),
|
||||
cfg.IntOpt('introspection_start_timeout',
|
||||
default=90,
|
||||
help="Timeout to start introspection"),
|
||||
cfg.IntOpt('hypervisor_update_sleep',
|
||||
default=60,
|
||||
help="Time to wait until nova becomes aware of "
|
||||
|
|
|
@ -177,11 +177,24 @@ class InspectorScenarioTest(BaremetalScenarioTest):
|
|||
node_ids = [node_ids]
|
||||
start = int(time.time())
|
||||
not_introspected = {node_id for node_id in node_ids}
|
||||
introspection_start_timeout = (
|
||||
CONF.baremetal_introspection.introspection_start_timeout)
|
||||
|
||||
while not_introspected:
|
||||
time.sleep(CONF.baremetal_introspection.introspection_sleep)
|
||||
for node_id in node_ids:
|
||||
status = self.introspection_status(node_id)
|
||||
try:
|
||||
status = self.introspection_status(node_id)
|
||||
except lib_exc.NotFound as exc:
|
||||
if int(time.time()) - start >= introspection_start_timeout:
|
||||
message = ('Node %(node_id)s did not appear in the '
|
||||
'baremetal introspection API after '
|
||||
'%(timeout)d seconds: %(error)s' %
|
||||
{'node_id': node_id, 'error': exc,
|
||||
'timeout': introspection_start_timeout})
|
||||
raise exceptions.IntrospectionFailed(message)
|
||||
else:
|
||||
continue
|
||||
if status['finished']:
|
||||
if status['error']:
|
||||
message = ('Node %(node_id)s introspection failed '
|
||||
|
|
Loading…
Reference in New Issue