def check_for_active_workflows(self, max_time): ''' Determine if are any active workflows. :param Time to wait (in 10 second intervals) :return: True - No active workflows False - Workflows are active ''' for dummy in range(0, max_time): nodes_data = fit_common.rackhdapi("/api/2.0/nodes") if nodes_data['status'] == 200 and len(nodes_data['json']) > 0: # if there are nodes present, determine if discovery has completed on them discovery_complete = True for node in nodes_data['json']: if node['type'] == 'compute': self.assertIn('id', node, 'node does not contain id') node_id = node['id'] # determine if there are any active worlflows. If so, discovery not completed if fit_common.check_active_workflows(node_id): discovery_complete = False break if discovery_complete: return True fit_common.time.sleep(10) return False