From fab4fcc397ce8d0ea1c817d14e5787689d0ef7ac Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 27 Jan 2017 20:05:00 -0600 Subject: [PATCH] Fix network create --project SDK 0.9.13 needs to see project_id in the attributes, not tenant_id. Closes-bug: 1659878 Change-Id: Iff7abe8bd00cbe087c07579596c40af8b0a73302 --- openstackclient/network/v2/network.py | 2 ++ openstackclient/tests/unit/network/v2/test_network.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index 17ce0f7fb4..655147d95f 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -93,7 +93,9 @@ def _get_attrs(client_manager, parsed_args): parsed_args.project, parsed_args.project_domain, ).id + # TODO(dtroyer): Remove tenant_id when we clean up the SDK refactor attrs['tenant_id'] = project_id + attrs['project_id'] = project_id # "network set" command doesn't support setting availability zone hints. if 'availability_zone_hints' in parsed_args and \ diff --git a/openstackclient/tests/unit/network/v2/test_network.py b/openstackclient/tests/unit/network/v2/test_network.py index c5283443e6..b405bef9a8 100644 --- a/openstackclient/tests/unit/network/v2/test_network.py +++ b/openstackclient/tests/unit/network/v2/test_network.py @@ -185,7 +185,9 @@ class TestCreateNetworkIdentityV3(TestNetwork): 'name': self._network.name, 'shared': True, 'description': self._network.description, + # TODO(dtroyer): Remove tenant_id when we clean up the SDK refactor 'tenant_id': self.project.id, + 'project_id': self.project.id, 'is_default': True, 'router:external': True, 'provider:network_type': 'vlan', @@ -319,7 +321,9 @@ class TestCreateNetworkIdentityV2(TestNetwork): self.network.create_network.assert_called_once_with(**{ 'admin_state_up': True, 'name': self._network.name, + # TODO(dtroyer): Remove tenant_id when we clean up the SDK refactor 'tenant_id': self.project.id, + 'project_id': self.project.id, }) self.assertEqual(self.columns, columns) self.assertEqual(self.data, data)