def get_nova_instances(conn):
    nova_instances = dict()
    try:
        for nova_instance in conn.compute.servers(details=False, all_projects=1):
            nova_instances[nova_instance.id] = nova_instance
        if (not nova_instances):
            raise RuntimeError('- PLEASE CHECK MANUALLY - did not get any nova instances back from the nova api - this should in theory never happen ...')
    except exceptions.HttpException as e:
        log.warn('- PLEASE CHECK MANUALLY - got an http exception connecting to openstack: %s', str(e))
        sys.exit(1)
    except exceptions.SDKException as e:
        log.warn('- PLEASE CHECK MANUALLY - got an sdk exception connecting to openstack: %s', str(e))
        sys.exit(1)
    if (not nova_instances):
        raise RuntimeError('Did not get any nova instances back.')
    return nova_instances
def get_nova_instances(conn):
    nova_instances = dict()
    try:
        for nova_instance in conn.compute.servers(details=False, all_projects=1):
            nova_instances[nova_instance.id] = nova_instance
        if (not nova_instances):
            raise RuntimeError('- PLEASE CHECK MANUALLY - did not get any nova instances back from the nova api - this should in theory never happen ...')
    except exceptions.HttpException as e:
        log.warn('- PLEASE CHECK MANUALLY - got an http exception connecting to openstack: %s', str(e))
        sys.exit(1)
    except exceptions.SDKException as e:
        log.warn('- PLEASE CHECK MANUALLY - got an sdk exception connecting to openstack: %s', str(e))
        sys.exit(1)
    if (not nova_instances):
        raise RuntimeError('Did not get any nova instances back.')
    return nova_instances