Rrevised for comments
@@ -78,7 +78,11 @@ NODE_STATUS = {}
START_TIME = time.time()
# download RackHD config from host
-rackhdconfig = fit_common.rackhdapi('/api/2.0/config')['json']
+rackhdresult = fit_common.rackhdapi('/api/2.0/config')
+if rackhdresult['status'] != 200:
+ log.error(" Unable to contact host, exiting. ")
+ sys.exit(255)
+rackhdconfig = rackhdresult['json']
rackhdhost = "http://" + str(rackhdconfig['apiServerAddress']) + ":" + str(rackhdconfig['apiServerPort'])
@@ -92,7 +96,7 @@ def wait_for_workflow_complete(taskid):
return False
if result['json']['status'] == 'running' or result['json']['status'] == 'pending':
log.info_5("{} workflow status: {}".format(result['json']['injectableName'], result['json']['status']))
- fit_common.time.sleep(30)
+ time.sleep(30)
elif result['json']['status'] == 'succeeded':
log.info_5("{} workflow status: {}".format(result['json']['injectableName'], result['json']['status']))
return True
