[Kimchi-devel] [PATCH] Fix issue #591: Get the right arch for MockModel

Aline Manera alinefm at linux.vnet.ibm.com
Wed Feb 11 19:42:01 UTC 2015


Use osinfo information to get the properly arch information when
creating a VM for feature tests.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 src/kimchi/model/featuretests.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/kimchi/model/featuretests.py b/src/kimchi/model/featuretests.py
index 5a45990..c9a0c78 100644
--- a/src/kimchi/model/featuretests.py
+++ b/src/kimchi/model/featuretests.py
@@ -20,15 +20,13 @@
 import cherrypy
 import libvirt
 import lxml.etree as ET
-import platform
 import socket
 import subprocess
 import threading
 
-
 from lxml.builder import E
 
-
+from kimchi import osinfo
 from kimchi.rollbackcontext import RollbackContext
 from kimchi.utils import kimchi_log, run_command
 
@@ -103,8 +101,8 @@ class FeatureTests(object):
     @staticmethod
     def libvirt_supports_iso_stream(conn, protocol):
         domain_type = 'test' if conn.getType().lower() == 'test' else 'kvm'
-        arch = 'ppc64' if platform.machine() == 'ppc64le' \
-            else platform.machine()
+        arch = osinfo.defaults['arch']
+        arch = 'ppc64' if arch == 'ppc64le' else arch
         xml = ISO_STREAM_XML % {'domain': domain_type, 'protocol': protocol,
                                 'arch': arch}
         try:
@@ -194,8 +192,8 @@ class FeatureTests(object):
             FeatureTests.disable_libvirt_error_logging()
             rollback.prependDefer(FeatureTests.enable_libvirt_error_logging)
             domain_type = 'test' if conn.getType().lower() == 'test' else 'kvm'
-            arch = 'ppc64' if platform.machine() == 'ppc64le' \
-                else platform.machine()
+            arch = osinfo.defaults['arch']
+            arch = 'ppc64' if arch == 'ppc64le' else arch
             dom = conn.defineXML(SIMPLE_VM_XML % {'domain': domain_type,
                                                   'arch': arch})
             rollback.prependDefer(dom.undefine)
-- 
2.1.0




More information about the Kimchi-devel mailing list