Add enabled flag to keystone service data
Services can be enabled or disabled. Add this flag to the service data structure. Change-Id: I879811e95829176a64dc34cf7bef09c25421c062
This commit is contained in:
parent
9035ade760
commit
8cb0eb3772
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- Keystone service descriptions were missing an attribute describing whether
|
||||
or not the service was enabled. A new 'enabled' boolean attribute has been
|
||||
added to the service data.
|
@ -193,6 +193,7 @@ def normalize_keystone_services(services):
|
||||
'description': service.get('description', None),
|
||||
'type': service_type,
|
||||
'service_type': service_type,
|
||||
'enabled': service['enabled']
|
||||
}
|
||||
ret.append(new_service)
|
||||
return meta.obj_list_to_dict(ret)
|
||||
|
@ -85,12 +85,14 @@ class FakeServer(object):
|
||||
|
||||
|
||||
class FakeService(object):
|
||||
def __init__(self, id, name, type, service_type, description=''):
|
||||
def __init__(self, id, name, type, service_type, description='',
|
||||
enabled=True):
|
||||
self.id = id
|
||||
self.name = name
|
||||
self.type = type
|
||||
self.service_type = service_type
|
||||
self.description = description
|
||||
self.enabled = enabled
|
||||
|
||||
|
||||
class FakeUser(object):
|
||||
|
@ -31,13 +31,13 @@ from shade.tests.unit import base
|
||||
class CloudServices(base.TestCase):
|
||||
mock_services = [
|
||||
{'id': 'id1', 'name': 'service1', 'type': 'type1',
|
||||
'service_type': 'type1', 'description': 'desc1'},
|
||||
'service_type': 'type1', 'description': 'desc1', 'enabled': True},
|
||||
{'id': 'id2', 'name': 'service2', 'type': 'type2',
|
||||
'service_type': 'type2', 'description': 'desc2'},
|
||||
'service_type': 'type2', 'description': 'desc2', 'enabled': True},
|
||||
{'id': 'id3', 'name': 'service3', 'type': 'type2',
|
||||
'service_type': 'type2', 'description': 'desc3'},
|
||||
'service_type': 'type2', 'description': 'desc3', 'enabled': True},
|
||||
{'id': 'id4', 'name': 'service4', 'type': 'type3',
|
||||
'service_type': 'type3', 'description': 'desc4'}
|
||||
'service_type': 'type3', 'description': 'desc4', 'enabled': True}
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
|
Loading…
Reference in New Issue
Block a user