diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2016-02-19 10:19:28 -0600 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2016-02-23 15:27:06 +0000 |
| commit | dccde70c57baf9266a795a54198238515d7fdda6 (patch) | |
| tree | 81f9e0a2a8402f4ac5ab75489418d7bc82e09873 /openstackclient/tests/network/v2/fakes.py | |
| parent | 20f86465af549bf43d34ba570fca12ffc74e6050 (diff) | |
| download | python-openstackclient-dccde70c57baf9266a795a54198238515d7fdda6.tar.gz | |
Add "security group rule show" command
Add the "os security group rule show" command which will use
the SDK when neutron is enabled, and use the nova client when
nova network is enabled.
Change-Id: I41efaa4468ec15e4e86d74144cc72edc25a29024
Partial-Bug: #1519512
Implements: blueprint neutron-client
Diffstat (limited to 'openstackclient/tests/network/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/network/v2/fakes.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py index fe31aab9..63b929e0 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/network/v2/fakes.py @@ -479,15 +479,13 @@ class FakeSecurityGroupRule(object): :param Dictionary methods: A dictionary with all methods :return: - A FakeResource object, with id, name, etc. + A FakeResource object, with id, etc. """ # Set default attributes. security_group_rule_attrs = { - 'description': 'security-group-rule-desc-' + uuid.uuid4().hex, 'direction': 'ingress', 'ethertype': 'IPv4', 'id': 'security-group-rule-id-' + uuid.uuid4().hex, - 'name': 'security-group-rule-name-' + uuid.uuid4().hex, 'port_range_max': None, 'port_range_min': None, 'protocol': None, @@ -501,7 +499,11 @@ class FakeSecurityGroupRule(object): security_group_rule_attrs.update(attrs) # Set default methods. - security_group_rule_methods = {} + security_group_rule_methods = { + 'keys': ['direction', 'ethertype', 'id', 'port_range_max', + 'port_range_min', 'protocol', 'remote_group_id', + 'remote_ip_prefix', 'security_group_id', 'tenant_id'], + } # Overwrite default methods. security_group_rule_methods.update(methods) @@ -510,6 +512,10 @@ class FakeSecurityGroupRule(object): info=copy.deepcopy(security_group_rule_attrs), methods=copy.deepcopy(security_group_rule_methods), loaded=True) + + # Set attributes with special mappings. + security_group_rule.project_id = security_group_rule_attrs['tenant_id'] + return security_group_rule @staticmethod |
