Skip to content

Commit 221cb53

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Fix creating a private flavor with ID auto"
2 parents 4d15a2a + d8749f9 commit 221cb53

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

openstackclient/compute/v2/flavor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def take_action(self, parsed_args):
167167
parsed_args.project_domain,
168168
).id
169169
compute_client.flavor_access.add_tenant_access(
170-
parsed_args.id, project_id)
170+
flavor.id, project_id)
171171
except Exception as e:
172172
msg = _("Failed to add project %(project)s access to "
173173
"flavor: %(e)s")

openstackclient/tests/unit/compute/v2/test_flavor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_flavor_create_other_options(self):
160160

161161
self.flavor.is_public = False
162162
arglist = [
163-
'--id', self.flavor.id,
163+
'--id', 'auto',
164164
'--ram', str(self.flavor.ram),
165165
'--disk', str(self.flavor.disk),
166166
'--ephemeral', str(self.flavor.ephemeral),
@@ -174,7 +174,6 @@ def test_flavor_create_other_options(self):
174174
self.flavor.name,
175175
]
176176
verifylist = [
177-
('id', self.flavor.id),
178177
('ram', self.flavor.ram),
179178
('disk', self.flavor.disk),
180179
('ephemeral', self.flavor.ephemeral),
@@ -193,7 +192,7 @@ def test_flavor_create_other_options(self):
193192
self.flavor.ram,
194193
self.flavor.vcpus,
195194
self.flavor.disk,
196-
self.flavor.id,
195+
'auto',
197196
self.flavor.ephemeral,
198197
self.flavor.swap,
199198
self.flavor.rxtx_factor,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fix ``--project`` option for ``flavor create`` command when the
5+
ID for the new flavor is auto generated.
6+
[Bug `1654221 <https://bugs.launchpad.net/bugs/1654221>`_]

0 commit comments

Comments
 (0)