Migrate lib/client/*.py from constants to pathutils
[ganeti-local] / lib / client / gnt_node.py
index 005501a..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],
@@ -960,8 +961,11 @@ def ListDrbd(opts, args):
     return constants.EXIT_FAILURE
 
   fields = ["node", "minor", "instance", "disk", "role", "peer"]
-  headers = {"node": "Node", "minor": "Minor", "instance": "Instance",
-             "disk": "Disk", "role": "Role", "peer": "PeerNode"}
+  if opts.no_headers:
+    headers = None
+  else:
+    headers = {"node": "Node", "minor": "Minor", "instance": "Instance",
+               "disk": "Disk", "role": "Role", "peer": "PeerNode"}
 
   data = GenerateTable(separator=opts.separator, headers=headers,
                        fields=fields, data=sorted(status.answer),
@@ -998,7 +1002,7 @@ commands = {
     MigrateNode, ARGS_ONE_NODE,
     [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT,
      IALLOCATOR_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT,
-     NORUNTIME_CHGS_OPT, SUBMIT_OPT, PRIORITY_OPT],
+     NORUNTIME_CHGS_OPT, SUBMIT_OPT],
     "[-f] <node>",
     "Migrate all the primary instance on a node away from it"
     " (only for instances of type drbd)"),