Migrate lib/client/*.py from constants to pathutils
authorMichael Hanselmann <hansmi@google.com>
Mon, 17 Sep 2012 16:28:54 +0000 (18:28 +0200)
committerMichael Hanselmann <hansmi@google.com>
Tue, 18 Sep 2012 15:09:20 +0000 (17:09 +0200)
File system paths moved from constants to pathutils.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/client/gnt_cluster.py
lib/client/gnt_node.py

index 309f37e..2759844 100644 (file)
@@ -42,6 +42,7 @@ from ganeti import objects
 from ganeti import uidpool
 from ganeti import compat
 from ganeti import netutils
+from ganeti import pathutils
 
 
 ON_OPT = cli_option("--on", default=False,
@@ -452,7 +453,7 @@ def ShowClusterConfig(opts, args):
   ToStdout("  - default instance allocator: %s", result["default_iallocator"])
   ToStdout("  - primary ip version: %d", result["primary_ip_version"])
   ToStdout("  - preallocation wipe disks: %s", result["prealloc_wipe_disks"])
-  ToStdout("  - OS search path: %s", utils.CommaJoin(constants.OS_SEARCH_PATH))
+  ToStdout("  - OS search path: %s", utils.CommaJoin(pathutils.OS_SEARCH_PATH))
 
   ToStdout("Default node parameters:")
   _PrintGroupedParams(result["ndparams"], roman=opts.roman_integers)
@@ -879,20 +880,20 @@ def _RenewCrypto(new_cluster_cert, new_rapi_cert, # pylint: disable=R0911
     files_to_copy = []
 
     if new_cluster_cert:
-      files_to_copy.append(constants.NODED_CERT_FILE)
+      files_to_copy.append(pathutils.NODED_CERT_FILE)
 
     if new_rapi_cert or rapi_cert_pem:
-      files_to_copy.append(constants.RAPI_CERT_FILE)
+      files_to_copy.append(pathutils.RAPI_CERT_FILE)
 
     if new_spice_cert or spice_cert_pem:
-      files_to_copy.append(constants.SPICE_CERT_FILE)
-      files_to_copy.append(constants.SPICE_CACERT_FILE)
+      files_to_copy.append(pathutils.SPICE_CERT_FILE)
+      files_to_copy.append(pathutils.SPICE_CACERT_FILE)
 
     if new_confd_hmac_key:
-      files_to_copy.append(constants.CONFD_HMAC_KEY)
+      files_to_copy.append(pathutils.CONFD_HMAC_KEY)
 
     if new_cds or cds:
-      files_to_copy.append(constants.CLUSTER_DOMAIN_SECRET_FILE)
+      files_to_copy.append(pathutils.CLUSTER_DOMAIN_SECRET_FILE)
 
     if files_to_copy:
       for node_name in ctx.nonmaster_nodes:
index 472ae68..98dc22d 100644 (file)
@@ -36,6 +36,7 @@ from ganeti import utils
 from ganeti import constants
 from ganeti import errors
 from ganeti import netutils
+from ganeti import pathutils
 from cStringIO import StringIO
 
 from ganeti import confd
@@ -143,7 +144,7 @@ def _RunSetupSSH(options, nodes):
 
   assert nodes, "Empty node list"
 
-  cmd = [constants.SETUP_SSH]
+  cmd = [pathutils.SETUP_SSH]
 
   # Pass --debug|--verbose to the external script if set on our invocation
   # --debug overrides --verbose
@@ -938,7 +939,7 @@ def ListDrbd(opts, args):
         status.failure = True
 
   node = args[0]
-  hmac = utils.ReadFile(constants.CONFD_HMAC_KEY)
+  hmac = utils.ReadFile(pathutils.CONFD_HMAC_KEY)
   filter_callback = confd_client.ConfdFilterCallback(ListDrbdConfdCallback)
   counting_callback = confd_client.ConfdCountingCallback(filter_callback)
   cf_client = confd_client.ConfdClient(hmac, [constants.IP4_ADDRESS_LOCALHOST],