# HG changeset patch
# User Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
# Date 1226292042 28800
# Node ID a949d69182419b086330dcac830da76d4b75a5a8
# Parent 8cb2952f699638eeb78dd49a54bd238153bc6a93
[TEST] Fixed vsmigrations.py lib for tc's 01_migratable_host.py and
02_host_migrate_type.py .
Fixed vsmigrations.py lib for tc's 01_migratable_host.py and 02_host_migrate_type.py
to work with
libvirt_cim revision < 668 as well.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 8cb2952f6996 -r a949d6918241
suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Sun
Nov 09 19:21:39 2008 -0800
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Sun
Nov 09 20:40:42 2008 -0800
@@ -30,7 +30,9 @@ from XenKvmLib import vxml
from XenKvmLib import vxml
from XenKvmLib.common_util import poll_for_state_change
from XenKvmLib import vsmigrations
-from XenKvmLib.vsmigrations import check_possible_host_migration, migrate_guest_to_host,
check_migration_job
+from XenKvmLib.vsmigrations import check_possible_host_migration, \
+ migrate_guest_to_host, \
+ check_migration_job
from XenKvmLib import enumclass
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main
diff -r 8cb2952f6996 -r a949d6918241 suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Sun Nov 09 19:21:39 2008 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsmigrations.py Sun Nov 09 20:40:42 2008 -0800
@@ -28,6 +28,9 @@ from XenKvmLib import enumclass
from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from XenKvmLib.xm_virt_util import domain_list
+from XenKvmLib.const import get_provider_version
+
+libvirt_mig_changes = 668
class CIM_VirtualSystemMigrationService(CIMMethodClass):
conn = None
@@ -106,7 +109,12 @@ def get_migration_job_instance(ip, virt,
def get_migration_job_instance(ip, virt, id):
job = []
key_list = ["instanceid"]
- mig_job_cn = get_typed_class(virt, 'MigrationJob')
+ curr_cim_rev, changeset = get_provider_version(virt, ip)
+ if curr_cim_rev < libvirt_mig_changes:
+ mig_job_cn = 'Virt_MigrationJob'
+ else:
+ mig_job_cn = get_typed_class(virt, 'MigrationJob')
+
try:
job = enumclass.EnumInstances(ip, mig_job_cn)
except Exception, details:
Show replies by date