[Kimchi-devel] [PATCH] issue #491: Check model parameter exists when generating the interface XML

Aline Manera alinefm at linux.vnet.ibm.com
Thu Dec 4 17:13:45 UTC 2014


When interface model is not explicitly set on interface XML, libvirt
automaticaly sets the default value.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 src/kimchi/xmlutils/interface.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/kimchi/xmlutils/interface.py b/src/kimchi/xmlutils/interface.py
index c76131a..7b79584 100644
--- a/src/kimchi/xmlutils/interface.py
+++ b/src/kimchi/xmlutils/interface.py
@@ -32,7 +32,9 @@ def get_iface_xml(params, arch=None, os_distro=None, os_version=None):
     """
     interface = E.interface(type=params['type'])
     interface.append(E.source(network=params['network']))
-    interface.append(E.model(type=params['model']))
+
+    if 'model' in params.keys():
+        interface.append(E.model(type=params['model']))
 
     mac = params.get('mac', None)
     if mac is not None:
-- 
1.9.3




More information about the Kimchi-devel mailing list