[Kimchi-devel] [PATCH] Fix issue 'unable to open database file' when run 'sudo src/wokd --environment=dev'

chandra at linux.vnet.ibm.com chandra at linux.vnet.ibm.com
Fri Oct 30 14:45:54 UTC 2015


From: chandrureddy <chandra at linux.vnet.ibm.com>

---
 src/wok/plugins/kimchi/root.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/wok/plugins/kimchi/root.py b/src/wok/plugins/kimchi/root.py
index 44452b4..37da8b3 100644
--- a/src/wok/plugins/kimchi/root.py
+++ b/src/wok/plugins/kimchi/root.py
@@ -30,6 +30,15 @@ from wok.root import WokRoot
 
 class KimchiRoot(WokRoot):
     def __init__(self, wok_options):
+        make_dirs = [
+            os.path.dirname(os.path.abspath(config.get_object_store())),
+            os.path.abspath(config.get_distros_store()),
+            os.path.abspath(config.get_screenshot_path())
+        ]
+        for directory in make_dirs:
+            if not os.path.isdir(directory):
+                os.makedirs(directory)
+
         if hasattr(wok_options, "model"):
             self.model = wok_options.model
         elif wok_options.test:
@@ -53,14 +62,5 @@ class KimchiRoot(WokRoot):
         self.domain = 'kimchi'
         self.messages = messages
 
-        make_dirs = [
-            os.path.dirname(os.path.abspath(config.get_object_store())),
-            os.path.abspath(config.get_distros_store()),
-            os.path.abspath(config.get_screenshot_path())
-        ]
-        for directory in make_dirs:
-            if not os.path.isdir(directory):
-                os.makedirs(directory)
-
     def get_custom_conf(self):
         return config.KimchiConfig()
-- 
2.1.0




More information about the Kimchi-devel mailing list