constants: Stop using wildcard import for pathutils
[ganeti-local] / lib / ssconf.py
index babd148..ae12149 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2008, 2010 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ from ganeti import utils
 from ganeti import serializer
 from ganeti import objects
 from ganeti import netutils
+from ganeti import pathutils
 
 
 SSCONF_LOCK_TIMEOUT = 10
@@ -48,7 +49,7 @@ class SimpleConfigReader(object):
   """Simple class to read configuration file.
 
   """
-  def __init__(self, file_name=constants.CLUSTER_CONF_FILE):
+  def __init__(self, file_name=pathutils.CLUSTER_CONF_FILE):
     """Initializes this class.
 
     @type file_name: string
@@ -273,7 +274,6 @@ class SimpleStore(object):
     - keys are restricted to predefined values
 
   """
-  _SS_FILEPREFIX = "ssconf_"
   _VALID_KEYS = (
     constants.SS_CLUSTER_NAME,
     constants.SS_CLUSTER_TAGS,
@@ -302,7 +302,7 @@ class SimpleStore(object):
 
   def __init__(self, cfg_location=None):
     if cfg_location is None:
-      self._cfg_dir = constants.DATA_DIR
+      self._cfg_dir = pathutils.DATA_DIR
     else:
       self._cfg_dir = cfg_location
 
@@ -314,7 +314,7 @@ class SimpleStore(object):
       raise errors.ProgrammerError("Invalid key requested from SSConf: '%s'"
                                    % str(key))
 
-    filename = self._cfg_dir + "/" + self._SS_FILEPREFIX + key
+    filename = self._cfg_dir + "/" + constants.SSCONF_FILEPREFIX + key
     return filename
 
   def _ReadFile(self, key, default=None):
@@ -342,7 +342,7 @@ class SimpleStore(object):
     @param values: Dictionary of (name, value)
 
     """
-    ssconf_lock = utils.FileLock.Open(constants.SSCONF_LOCK_FILE)
+    ssconf_lock = utils.FileLock.Open(pathutils.SSCONF_LOCK_FILE)
 
     # Get lock while writing files
     ssconf_lock.Exclusive(blocking=True, timeout=SSCONF_LOCK_TIMEOUT)