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

Sharad Mishra snmishra at us.ibm.com
Thu Dec 17 16:28:23 UTC 2009


+1

Sharad Mishra
System x Enablement
Linux Technology Center
IBM


                                                                           
             Kaitlin Rupert                                                
             <kaitlin at linux.vn                                             
             et.ibm.com>                                                To 
             Sent by:                  libvirt-cim at redhat.com              
             libvirt-cim-bounc                                          cc 
             es at redhat.com                                                 
                                                                   Subject 
                                       [Libvirt-cim] [PATCH] [TEST] Get    
             12/11/2009 05:17          the proper default net template     
             PM                        RASD                                
                                                                           
                                                                           
             Please respond to                                             
                 List for                                                  
              discussion and                                               
              development of                                               
                libvirt CIM                                                
             <libvirt-cim at redh                                             
                  at.com>                                                  
                                                                           
                                                                           




# HG changeset patch
# User Kaitlin Rupert <karupert at 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 at 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 at redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20091217/8afb874a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20091217/8afb874a/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic26931.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20091217/8afb874a/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20091217/8afb874a/attachment-0002.gif>


More information about the Libvirt-cim mailing list