From c09254c2e5fdc6fdf16bb0e9d04f5e7772cfb591 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Fri, 8 Jun 2012 12:44:28 +0200
Subject: [PATCH] Move the ssconf file prefix constant to constants.py

This way, it can be reused in the Haskell code too.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/constants.py | 2 ++
 lib/ssconf.py    | 5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/constants.py b/lib/constants.py
index e5b10746a..b76863e9b 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -1698,6 +1698,8 @@ RSS_DESCRIPTION = {
 MAX_NICS = 8
 MAX_DISKS = 16
 
+# SSCONF file prefix
+SSCONF_FILEPREFIX = "ssconf_"
 # SSCONF keys
 SS_CLUSTER_NAME = "cluster_name"
 SS_CLUSTER_TAGS = "cluster_tags"
diff --git a/lib/ssconf.py b/lib/ssconf.py
index babd148e6..2399d8106 100644
--- a/lib/ssconf.py
+++ b/lib/ssconf.py
@@ -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
@@ -273,7 +273,6 @@ class SimpleStore(object):
     - keys are restricted to predefined values
 
   """
-  _SS_FILEPREFIX = "ssconf_"
   _VALID_KEYS = (
     constants.SS_CLUSTER_NAME,
     constants.SS_CLUSTER_TAGS,
@@ -314,7 +313,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):
-- 
GitLab