summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-07-26 18:46:30 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-07-26 18:46:30 +0000
commit177ad3f61268c58bbbd211d6255381fc8b85c58d (patch)
tree4ddc1681e70039e05cac08858c8a038bcc77cdce
parent39a40142254d4dbad8dfe1509d92e7e9fdbb44fb (diff)
downloadnova-177ad3f61268c58bbbd211d6255381fc8b85c58d.tar.gz
nova-177ad3f61268c58bbbd211d6255381fc8b85c58d.tar.xz
nova-177ad3f61268c58bbbd211d6255381fc8b85c58d.zip
Fix resizing VDIs on XenServer >= 6
The check used 'is' when it should have been '=='. Also, a couple of small cleanups to make the code easier to read. Change-Id: If98892703bc557732093230b023085c4744b8455
-rw-r--r--nova/virt/xenapi/vmops.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 5dcc53b94..91e41c261 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -799,17 +799,18 @@ class VMOps(object):
def check_resize_func_name(self):
"""Check the function name used to resize an instance based
- on product_brand and product_version."""
- if ((self._session.product_brand == 'XCP' and
- (self._session.product_version[0] == 1 and
- self._session.product_version[1] > 1)) or
- (self._session.product_brand == 'XCP' and
- self._session.product_version[0] > 1) or
- (self._session.product_brand is 'XenServer' and
- self._session.product_version[0] > 5)):
+ on product_brand and product_version."""
+ if (self._session.product_brand == 'XCP' and
+ ((self._session.product_version[0] == 1 and
+ self._session.product_version[1] > 1) or
+ self._session.product_version[0] > 1)):
return 'VDI.resize'
- else:
- return 'VDI.resize_online'
+
+ if (self._session.product_brand == 'XenServer' and
+ self._session.product_version[0] > 5):
+ return 'VDI.resize'
+
+ return 'VDI.resize_online'
def reboot(self, instance, reboot_type):
"""Reboot VM instance."""