+1
Sharad Mishra
System x Enablement
Linux Technology Center
IBM
Kaitlin Rupert
<kaitlin(a)linux.vn
et.ibm.com> To
Sent by: libvirt-cim(a)redhat.com
libvirt-cim-bounc cc
es(a)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@redh
at.com>
# HG changeset patch
# User Kaitlin Rupert <karupert(a)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(a)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(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim