[Libvirt-cim] [PATCH 1 of 4] [TEST] Moving the check for cimom to function

Deepti B. Kalakeri deeptik at linux.vnet.ibm.com
Wed Sep 2 12:11:57 UTC 2009


# HG changeset patch
# User Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
# Date 1251890125 25200
# Node ID 94551c9ef9b0fa53cb2ff04a5af16c8504a1da0b
# Parent  4ccfbf5da9c6a03d994246d415c4ada5484594bc
[TEST] Moving the check for cimom to function.

Tested with F11/SLES11 with and w/o sblim-cmpi-base and KVM with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>

diff -r 4ccfbf5da9c6 -r 94551c9ef9b0 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py	Tue Sep 01 00:21:50 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py	Wed Sep 02 04:15:25 2009 -0700
@@ -230,6 +230,19 @@
         profiles[key]['InstanceID'] = 'CIM:' + key
     return profiles 
 
+def check_cimom(ip):
+    cmd = "ps -ef | grep -v grep | grep cimserver"
+    rc, out = utils.run_remote(ip, cmd)
+    if rc != 0:
+        cmd = "ps -ef | grep -v grep | grep sfcbd"
+        rc, out = utils.run_remote(ip, cmd)
+
+    if rc == 0 :
+        cmd = "%s | awk '{ print \$8 }' | uniq" % cmd
+        rc, out = utils.run_remote(ip, cmd)
+
+    return rc, out
+
 def pre_check(ip, virt):
     cmd = "virsh -c %s list --all" % virt2uri(virt)
     ret, out = utils.run_remote(ip, cmd)
@@ -250,13 +263,9 @@
             if ret != 0: 
                 return "Encountered an error querying for qemu-kvm and qemu " 
 
-    cmd = "ps -ef | grep -v grep | grep cimserver"
-    rc, out = utils.run_remote(ip, cmd)
+    rc, out = check_cimom(ip)
     if rc != 0:
-        cmd = "ps -ef | grep -v grep | grep sfcbd"
-        rc, out = utils.run_remote(ip, cmd)
-        if rc != 0:
-            return "A supported CIMOM is not running" 
+        return "A supported CIMOM is not running" 
 
     cmd = "ps -ef | grep -v grep | grep libvirtd"
     rc, out = utils.run_remote(ip, cmd)




More information about the Libvirt-cim mailing list