diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-01-06 05:57:35 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-01-06 05:57:35 +0000 |
| commit | 221cb5318ea8774abff36f73e127f89dcdb510f4 (patch) | |
| tree | eb5e8e5c6e620cdc66dd91b062df7c89555af273 | |
| parent | 4d15a2a8fc50e64c73001a56d15763778f6dda5b (diff) | |
| parent | d8749f9148f2a78f28e91c58e698779735eae4dc (diff) | |
| download | python-openstackclient-221cb5318ea8774abff36f73e127f89dcdb510f4.tar.gz | |
Merge "Fix creating a private flavor with ID auto"
| -rw-r--r-- | openstackclient/compute/v2/flavor.py | 2 | ||||
| -rw-r--r-- | openstackclient/tests/unit/compute/v2/test_flavor.py | 5 | ||||
| -rw-r--r-- | releasenotes/notes/bug-1654221-a564ab75a6afc332.yaml | 6 |
3 files changed, 9 insertions, 4 deletions
diff --git a/openstackclient/compute/v2/flavor.py b/openstackclient/compute/v2/flavor.py index f20d154b..e562cd40 100644 --- a/openstackclient/compute/v2/flavor.py +++ b/openstackclient/compute/v2/flavor.py @@ -167,7 +167,7 @@ class CreateFlavor(command.ShowOne): parsed_args.project_domain, ).id compute_client.flavor_access.add_tenant_access( - parsed_args.id, project_id) + flavor.id, project_id) except Exception as e: msg = _("Failed to add project %(project)s access to " "flavor: %(e)s") diff --git a/openstackclient/tests/unit/compute/v2/test_flavor.py b/openstackclient/tests/unit/compute/v2/test_flavor.py index 93ad9d14..632fcda1 100644 --- a/openstackclient/tests/unit/compute/v2/test_flavor.py +++ b/openstackclient/tests/unit/compute/v2/test_flavor.py @@ -160,7 +160,7 @@ class TestFlavorCreate(TestFlavor): self.flavor.is_public = False arglist = [ - '--id', self.flavor.id, + '--id', 'auto', '--ram', str(self.flavor.ram), '--disk', str(self.flavor.disk), '--ephemeral', str(self.flavor.ephemeral), @@ -174,7 +174,6 @@ class TestFlavorCreate(TestFlavor): self.flavor.name, ] verifylist = [ - ('id', self.flavor.id), ('ram', self.flavor.ram), ('disk', self.flavor.disk), ('ephemeral', self.flavor.ephemeral), @@ -193,7 +192,7 @@ class TestFlavorCreate(TestFlavor): self.flavor.ram, self.flavor.vcpus, self.flavor.disk, - self.flavor.id, + 'auto', self.flavor.ephemeral, self.flavor.swap, self.flavor.rxtx_factor, diff --git a/releasenotes/notes/bug-1654221-a564ab75a6afc332.yaml b/releasenotes/notes/bug-1654221-a564ab75a6afc332.yaml new file mode 100644 index 00000000..5f7132ff --- /dev/null +++ b/releasenotes/notes/bug-1654221-a564ab75a6afc332.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix ``--project`` option for ``flavor create`` command when the + ID for the new flavor is auto generated. + [Bug `1654221 <https://bugs.launchpad.net/bugs/1654221>`_] |
