Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Fix failing of listing services
Browse files Browse the repository at this point in the history
Non admin user or a user with no such privileges can't list
services. Therefor cinder-backup and metering services can't
be discovered for such a user.
The patch adds a warning to inform the user.

Change-Id: I48119b7a48f49f58dfac7bf34c75a08681b9ae32
  • Loading branch information
kopecmartin committed Apr 5, 2018
1 parent 6a10dbb commit c1951c3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions config_tempest/main.py
Expand Up @@ -512,7 +512,12 @@ def create_tempest_images(client, conf, image_path, allow_creation,


def check_ceilometer_service(client, conf, services):
services = client.list_services(**{'type': 'metering'})
try:
services = client.list_services(**{'type': 'metering'})
except exceptions.Forbidden:
LOG.warning("User has no permissions to list services - "
"metering service can't be discovered.")
return
if services and len(services['services']):
metering = services['services'][0]
if 'ceilometer' in metering['name'] and metering['enabled']:
Expand All @@ -524,8 +529,13 @@ def check_volume_backup_service(client, conf, services):
if 'volumev3' not in services:
LOG.info("No volume service found, skipping backup service check")
return
params = {'binary': 'cinder-backup'}
backup_service = client.list_services(**params)
try:
params = {'binary': 'cinder-backup'}
backup_service = client.list_services(**params)
except exceptions.Forbidden:
LOG.warning("User has no permissions to list services - "
"cinder-backup service can't be discovered.")
return

if backup_service:
# We only set backup to false if the service isn't running otherwise we
Expand Down

0 comments on commit c1951c3

Please sign in to comment.