diff options
| author | Brad Behle <behle@us.ibm.com> | 2016-02-04 17:19:37 -0600 |
|---|---|---|
| committer | Brad Behle <behle@us.ibm.com> | 2016-02-22 13:04:25 -0600 |
| commit | 112d7b0e0966599aa940de4c0598cea759780785 (patch) | |
| tree | fab9ae2e815c303d41451fb3f258925bb309e1b0 /openstackclient/tests/network/v2/fakes.py | |
| parent | ba08683d90277e3cc6f943a2a994ccf08589cb1a (diff) | |
| download | python-openstackclient-112d7b0e0966599aa940de4c0598cea759780785.tar.gz | |
Add "os subnet show" command using SDK
Implement the openstack client subnet show command using SDK
calls. This shows the details of a specific subnet.
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Partially implements: blueprint neutron-client
Closes-Bug: #1542359
Change-Id: Iaf18b9e44af35ca0cd61033b468e0c60cd3b05d6
Diffstat (limited to 'openstackclient/tests/network/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/network/v2/fakes.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index 680e9cbf..c24410e1 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -550,18 +550,22 @@ class FakeSubnet(object): A FakeResource object faking the subnet """ # Set default attributes. + project_id = 'project-id-' + uuid.uuid4().hex subnet_attrs = { 'id': 'subnet-id-' + uuid.uuid4().hex, 'name': 'subnet-name-' + uuid.uuid4().hex, 'network_id': 'network-id-' + uuid.uuid4().hex, 'cidr': '10.10.10.0/24', - 'tenant_id': 'project-id-' + uuid.uuid4().hex, + 'tenant_id': project_id, 'enable_dhcp': True, 'dns_nameservers': [], 'allocation_pools': [], 'host_routes': [], 'ip_version': '4', 'gateway_ip': '10.10.10.1', + 'ipv6_address_mode': 'None', + 'ipv6_ra_mode': 'None', + 'subnetpool_id': 'None', } # Overwrite default attributes. @@ -571,7 +575,8 @@ class FakeSubnet(object): subnet_methods = { 'keys': ['id', 'name', 'network_id', 'cidr', 'enable_dhcp', 'allocation_pools', 'dns_nameservers', 'gateway_ip', - 'host_routes', 'ip_version', 'tenant_id'] + 'host_routes', 'ip_version', 'tenant_id', + 'ipv6_address_mode', 'ipv6_ra_mode', 'subnetpool_id'] } # Overwrite default methods. @@ -580,6 +585,8 @@ class FakeSubnet(object): subnet = fakes.FakeResource(info=copy.deepcopy(subnet_attrs), methods=copy.deepcopy(subnet_methods), loaded=True) + # Set attributes with special mappings in OpenStack SDK. + subnet.project_id = subnet_attrs['tenant_id'] return subnet |
