Fixes Attribute Error when trying to spawn instance from vhd on HyperV
When trying to boot an instance from a vhd image we get a AttributeError.
This happens when we try to get the root disk size from the old flavor.
Since on creation there is no old flavor, instance.get_flavor() will return
None and thus the AttributeError when trying to return te root_gb.
This patch fixes this problem by checking if the return value from
instance.get_flavor() is None, in which case it returns
instance.root_gb.
Reviewed: https:/ /review. openstack. org/156154 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=bbd4b5f372d 1241f8f817e5aaf bbd1aee2b385cd
Committed: https:/
Submitter: Jenkins
Branch: master
commit bbd4b5f372d1241 f8f817e5aafbbd1 aee2b385cd
Author: Adelina Tuvenie <email address hidden>
Date: Thu Feb 12 09:07:57 2015 -0800
Fixes Attribute Error when trying to spawn instance from vhd on HyperV
When trying to boot an instance from a vhd image we get a AttributeError. get_flavor( ) will return
This happens when we try to get the root disk size from the old flavor.
Since on creation there is no old flavor, instance.
None and thus the AttributeError when trying to return te root_gb.
This patch fixes this problem by checking if the return value from get_flavor( ) is None, in which case it returns root_gb.
instance.
instance.
Change-Id: Ief16679a6b80f6 f8b9246ea6a5077 3e40824bb7f
Closes-Bug: 1421272