+1

Sharad Mishra
System x Enablement
Linux Technology Center
IBM

Inactive hide details for Kaitlin Rupert ---12/11/2009 05:07:25 PM---# HG changeset patchKaitlin Rupert ---12/11/2009 05:07:25 PM---# HG changeset patch

          Kaitlin Rupert <kaitlin@linux.vnet.ibm.com>
          Sent by: libvirt-cim-bounces@redhat.com

          12/11/2009 05:17 PM
          Please respond to
          List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>


To

libvirt-cim@redhat.com

cc


Subject

[Libvirt-cim] [PATCH] [TEST] Get the proper default net template RASD

# HG changeset patch
# User Kaitlin Rupert <karupert@us.ibm.com>
# Date 1260576721 28800
# Node ID 7635e4deb3516ffe938ee597bd5e771cd7fae491
# Parent  4c73bb18cd2d6144debd06135ad8de6e569f6747
[TEST] Get the proper default net template RASD

The test caes assume "network" for the default interface type.  Depending on
how the templates are returned, SettingsDefineCapabilities might return a
"bridge" or "user" type interface.  This fix adds some additional filtering
to get the proper template.


Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>

diff -r 4c73bb18cd2d -r 7635e4deb351 suites/libvirt-cim/lib/XenKvmLib/rasd.py
--- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri Dec 11 16:12:01 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py Fri Dec 11 16:12:01 2009 -0800
@@ -29,7 +29,7 @@
from XenKvmLib.enumclass import GetInstance, EnumInstances
from XenKvmLib.assoc import Associators
from XenKvmLib.const import default_pool_name, default_network_name, \
-                            get_provider_version
+                            get_provider_version, default_net_type
from XenKvmLib.pool import enum_volumes
from XenKvmLib.xm_virt_util import virsh_version
from XenKvmLib.common_util import parse_instance_id
@@ -251,6 +251,8 @@
            ac_id_list.append("NetworkPool/%s" % default_network_name)
            ac_id_list.append("ProcessorPool/0")

+    net_cn = "NetResourceAllocationSettingData"
+
    templates = []
   
    for id in ac_id_list:
@@ -260,7 +262,10 @@
            return []

        for rasd in rasd_list:
-            if rasd['InstanceID'] == "Default":
+            if rasd['InstanceID'] == "Default":
+                if rasd.classname.find(net_cn) > 0 and \
+                   rasd['NetworkType'] != default_net_type:
+                    continue
                templates.append(rasd)

    return templates

_______________________________________________
Libvirt-cim mailing list
Libvirt-cim@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim