From: root <root(a)RH64wenchao.(none)>
Signed-off-by: Wenchao Xia <xiawenc(a)linux.vnet.ibm.com>
---
.../12_create_netfs_storagevolume_errs.py | 2 +-
suites/libvirt-cim/lib/XenKvmLib/common_util.py | 4 ++--
suites/libvirt-cim/lib/XenKvmLib/pool.py | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git
a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/12_create_netfs_storagevolume_errs.py
b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/12_create_netfs_storagevolume_errs.py
index 004af9f..27cb2f7 100644
---
a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/12_create_netfs_storagevolume_errs.py
+++
b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/12_create_netfs_storagevolume_errs.py
@@ -154,7 +154,7 @@ def main():
if status != PASS :
raise Exception("Failed to verify the Invlaid '%s' " %
pool_name)
-
+
except Exception, details:
logger.error("Exception details: %s", details)
status = FAIL
diff --git a/suites/libvirt-cim/lib/XenKvmLib/common_util.py
b/suites/libvirt-cim/lib/XenKvmLib/common_util.py
index 3316c51..efcda92 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py
@@ -536,8 +536,8 @@ def get_nfs_bin(server):
if elems[0] == 'Fedora' or (elems[0] == 'Red' and elems[1] ==
'Hat'):
for i in range(1, len(elems)):
if elems[i] == 'release':
- if (elems[0] == 'Fedora' and int(elems[i+1]) >= 15) or \
- (elems[0] == 'Red' and int(elems[i+1]) >= 7):
+ if (elems[0] == 'Fedora' and get_version_number(elems[i+1])
>= 1500) or \
+ (elems[0] == 'Red' and get_version_number(elems[i+1])
>= 700):
# Handle this differently - the command would be
# "systemctl {start|restart|status} nfs"
nfs_server_bin = "systemctl %s nfs"
diff --git a/suites/libvirt-cim/lib/XenKvmLib/pool.py
b/suites/libvirt-cim/lib/XenKvmLib/pool.py
index a5ca331..86898b1 100644
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py
@@ -26,7 +26,7 @@ from VirtLib import utils
from CimTest.Globals import logger, CIM_NS
from CimTest.ReturnCodes import PASS, FAIL, SKIP
from XenKvmLib.classes import get_typed_class, inst_to_mof
-from XenKvmLib.const import get_provider_version, default_pool_name
+from XenKvmLib.const import get_provider_version, default_pool_name
from XenKvmLib.enumclass import EnumInstances, GetInstance, EnumNames
from XenKvmLib.assoc import Associators
from VirtLib.utils import run_remote
@@ -37,7 +37,7 @@ from CimTest.CimExt import CIMClassMOF
from XenKvmLib.vxml import NetXML, PoolXML
from XenKvmLib.xm_virt_util import virsh_version
from XenKvmLib.vsms import RASD_TYPE_STOREVOL
-from XenKvmLib.common_util import destroy_diskpool
+from XenKvmLib.common_util import destroy_diskpool, get_version_number
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
cim_mname = "CreateChildResourcePool"
@@ -183,7 +183,7 @@ def undefine_netpool(server, virt, net_name):
def undefine_diskpool(server, virt, dp_name):
libvirt_version = virsh_version(server, virt)
- if libvirt_version >= '0.4.1':
+ if get_version_number(libvirt_version) >= get_version_number("0.4.1"):
if dp_name == None:
return FAIL
@@ -403,7 +403,7 @@ def cleanup_pool_vol(server, virt, pool_name, vol_name,
status = destroy_diskpool(server, virt, pool_name)
if status != PASS:
raise Exception("Unable to destroy diskpool '%s'" %
pool_name)
- else:
+ else:
status = undefine_diskpool(server, virt, pool_name)
if status != PASS:
raise Exception("Unable to undefine diskpool '%s'"
\
--
1.7.1