[Kimchi-devel] [PATCH] [Kimchi] mockmodel.py: fixing virtviewerfile_tmp path

dhbarboza82 at gmail.com dhbarboza82 at gmail.com
Tue Aug 30 17:36:23 UTC 2016


From: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>

Instead of using relative path, use the path provided by
kimchi config. Otherwise, when running WoK tests, the
'wok/data/virtviewerfiles/' dir will be wrongly created
and used by the mockmodel.

Signed-off-by: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
---
 mockmodel.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mockmodel.py b/mockmodel.py
index cd06ee3..61e5ee1 100644
--- a/mockmodel.py
+++ b/mockmodel.py
@@ -33,6 +33,7 @@ from wok.objectstore import ObjectStore
 from wok.utils import add_task, convert_data_size
 from wok.xmlutils.utils import xml_item_update
 
+from wok.plugins.kimchi import config as kimchi_config
 from wok.plugins.kimchi import imageinfo
 from wok.plugins.kimchi import osinfo
 from wok.plugins.kimchi.model import cpuinfo
@@ -141,7 +142,7 @@ class MockModel(Model):
         cherrypy.engine.subscribe('exit', self.virtviewertmpfile_cleanup)
 
     def _create_virt_viewer_tmp_file(self):
-        path = '../data/virtviewerfiles/'
+        path = kimchi_config.get_virtviewerfiles_path()
         if not os.path.isdir(path):
             os.makedirs(path)
 
-- 
2.5.5




More information about the Kimchi-devel mailing list