Skip to content

Commit cf489d5

Browse files
committed
Remove FlavorNotFound dead code condition in API.resize
The condition removed in this change is dead code because of the block above where new_instance_type is set. If a new flavor is specified (resize) then flavors.get_flavor_by_flavor_id will either find it or raise FlavorNotFound. Change-Id: If66a28c07c619cb89d77ee926f60b5d48cbfd351
1 parent 8951149 commit cf489d5

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

nova/compute/api.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3652,9 +3652,6 @@ def resize(self, context, instance, flavor_id=None, clean_shutdown=True,
36523652
reason = _('Resize to zero disk flavor is not allowed.')
36533653
raise exception.CannotResizeDisk(reason=reason)
36543654

3655-
if not new_instance_type:
3656-
raise exception.FlavorNotFound(flavor_id=flavor_id)
3657-
36583655
current_instance_type_name = current_instance_type['name']
36593656
new_instance_type_name = new_instance_type['name']
36603657
LOG.debug("Old instance type %(current_instance_type_name)s, "

0 commit comments

Comments
 (0)