Cleanup services decorator

Rather than repeating the list of services twice, use the
one defined in get_service_list. Note that this removes
baremetal from the list of accepted services.

Change-Id: Ib5a9b33a54ef1064f5dc8f6206ddd1c7d218fc8e
This commit is contained in:
Andrea Frittoli 2017-04-09 19:22:47 +02:00
parent 0d93900ba6
commit 6f05307629
1 changed files with 3 additions and 3 deletions

View File

@ -82,10 +82,10 @@ def services(*args):
exercised by a test case.
"""
def decorator(f):
services = ['compute', 'image', 'baremetal', 'volume',
'network', 'identity', 'object_storage']
known_services = get_service_list()
for service in args:
if service not in services:
if service not in known_services:
raise exceptions.InvalidServiceTag('%s is not a valid '
'service' % service)
attr(type=list(args))(f)