

def _get_compute_nodes(self, accommodation):
    try:
        return nova.get_available_compute_nodes(self.openstack_client.nova)
    except nova.ForbiddenException:
        LOG.info('OpenStack user does not have permission to list compute nodes - treat him as non-admin')
        self.privileged_mode = False
        count = accommodation.get('compute_nodes')
        if (not count):
            raise DeploymentException('When run with non-admin user the scenario must specify number of compute nodes to use')
        zones = (accommodation.get('zones') or ['nova'])
        return [dict(host=None, zone=zones[(n % len(zones))]) for n in range(count)]

dataset/ETHPy150Open openstack/shaker/shaker/engine/deploy.py Deployment._get_compute_nodes/original