diff options
| author | zhiyuan_cai <luckyvega.g@gmail.com> | 2015-01-04 11:26:18 +0800 |
|---|---|---|
| committer | zhiyuan_cai <luckyvega.g@gmail.com> | 2015-01-04 11:26:18 +0800 |
| commit | 369ae3f9f06c90e8d57b71befa6bc22a843c2f7d (patch) | |
| tree | fbde9519581762b92cf6c8e11454be9e7e528d06 /openstackclient/tests/identity/v3/fakes.py | |
| parent | cbb26724fccdbbb76913a8f2994768dea3046480 (diff) | |
| download | python-openstackclient-369ae3f9f06c90e8d57b71befa6bc22a843c2f7d.tar.gz | |
Check if service.name available before access
Currently v3 endpoint commands access service.name directly, while
name is not a required attribute of service. So if we associate an
endpoint to a service without name, we will get an AttributeError
executing v3 endpoint commands later. This patch addresses this
issue by checking if service.name is available before accessing it.
Change-Id: I3dd686ef02a2e21e2049a49cb55634385c2ecfaf
Closes-Bug: #1406737
Diffstat (limited to 'openstackclient/tests/identity/v3/fakes.py')
| -rw-r--r-- | openstackclient/tests/identity/v3/fakes.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openstackclient/tests/identity/v3/fakes.py b/openstackclient/tests/identity/v3/fakes.py index 3afb0cd9..68e67519 100644 --- a/openstackclient/tests/identity/v3/fakes.py +++ b/openstackclient/tests/identity/v3/fakes.py @@ -158,6 +158,14 @@ SERVICE = { 'links': base_url + 'services/' + service_id, } +SERVICE_WITHOUT_NAME = { + 'id': service_id, + 'type': service_type, + 'description': service_description, + 'enabled': True, + 'links': base_url + 'services/' + service_id, +} + endpoint_id = 'e-123' endpoint_url = 'http://127.0.0.1:35357' endpoint_region = 'RegionOne' |
