From 290cf66cb7a5a6568bd090431793a2639ef4c4b9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 10 May 2014 15:48:42 +0100 Subject: [PATCH] Change node power subcommands. 'mclu wake' -> 'mclu on' 'mclu shutdown' -> 'mclu off' --- Makefile.am | 4 ++-- README | 4 ++-- lib.py | 2 +- mclu.py | 8 ++++---- mclu_build.py | 2 +- mclu_import.py | 2 +- mclu_shutdown.py => mclu_off.py | 2 +- mclu_wake.py => mclu_on.py | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) rename mclu_shutdown.py => mclu_off.py (98%) rename mclu_wake.py => mclu_on.py (96%) diff --git a/Makefile.am b/Makefile.am index b67553d..e5fd98f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,13 +36,13 @@ pkgdata_SCRIPTS = \ mclu_info.py \ mclu_list.py \ mclu_migrate.py \ + mclu_off.py \ + mclu_on.py \ mclu_reboot.py \ - mclu_shutdown.py \ mclu_start.py \ mclu_status.py \ mclu_stop.py \ mclu_viewer.py \ - mclu_wake.py \ node.py # Configuration file. diff --git a/README b/README index f9feeb1..f63c742 100644 --- a/README +++ b/README @@ -17,8 +17,8 @@ Example commands mclu status Display status of the cluster mclu list List all virtual machines on the cluster - mclu wake ham0 Wake up node 'ham0' in the cluster - mclu shutdown ham0 Shut down node 'ham0' in the cluster + mclu on ham0 Switch on (wake-on-LAN) node 'ham0' + mclu off ham0 Power off node 'ham0' in the cluster mclu start ham0:vm Start vm on node 'ham0' mclu stop ham0:* Stop all VMs on node 'ham0' mclu migrate *:* ham2: Live migrate all VMs to 'ham2' diff --git a/lib.py b/lib.py index a4981da..961b5b0 100644 --- a/lib.py +++ b/lib.py @@ -104,5 +104,5 @@ def pick_any_node_which_is_up (nodes): node = n break if not node: - sys.exit ("error: no nodes are up, use mclu wake [node|--all]") + sys.exit ("error: no nodes are up, use mclu on [node|--all]") return node diff --git a/mclu.py b/mclu.py index 16fdcca..7c6ad81 100755 --- a/mclu.py +++ b/mclu.py @@ -50,10 +50,12 @@ import mclu_list mclu_list.cmdline (subparsers) import mclu_migrate mclu_migrate.cmdline (subparsers) +import mclu_off +mclu_off.cmdline (subparsers) +import mclu_on +mclu_on.cmdline (subparsers) import mclu_reboot mclu_reboot.cmdline (subparsers) -import mclu_shutdown -mclu_shutdown.cmdline (subparsers) import mclu_start mclu_start.cmdline (subparsers) import mclu_status @@ -62,8 +64,6 @@ import mclu_stop mclu_stop.cmdline (subparsers) import mclu_viewer mclu_viewer.cmdline (subparsers) -import mclu_wake -mclu_wake.cmdline (subparsers) args = parser.parse_args() diff --git a/mclu_build.py b/mclu_build.py index 5ae8bae..431602b 100644 --- a/mclu_build.py +++ b/mclu_build.py @@ -72,7 +72,7 @@ def run (c, args, nodes): if node_name in nodes: node = nodes[node_name] if not node.ping (): - sys.exit ("error: requested node (%s) is not up, use mclu wake %s" % + sys.exit ("error: requested node (%s) is not up, use mclu on %s" % (node_name, node_name)) else: sys.exit ("error: requested node (%s) does not exist" % node_name) diff --git a/mclu_import.py b/mclu_import.py index a306f8d..f808182 100644 --- a/mclu_import.py +++ b/mclu_import.py @@ -63,7 +63,7 @@ def run (c, args, nodes): if node_name in nodes: node = nodes[node_name] if not node.ping (): - sys.exit ("error: requested node (%s) is not up, use mclu wake %s" % + sys.exit ("error: requested node (%s) is not up, use mclu on %s" % (node_name, node_name)) else: sys.exit ("error: requested node (%s) does not exist" % node_name) diff --git a/mclu_shutdown.py b/mclu_off.py similarity index 98% rename from mclu_shutdown.py rename to mclu_off.py index 2a791dd..10ae06a 100644 --- a/mclu_shutdown.py +++ b/mclu_off.py @@ -25,7 +25,7 @@ import lib def cmdline (subparsers): p = subparsers.add_parser ( - 'shutdown', + 'off', help='power off a node (or nodes)' ) p.add_argument ( diff --git a/mclu_wake.py b/mclu_on.py similarity index 96% rename from mclu_wake.py rename to mclu_on.py index 2cee72b..31ff86c 100644 --- a/mclu_wake.py +++ b/mclu_on.py @@ -25,8 +25,8 @@ import lib def cmdline (subparsers): p = subparsers.add_parser ( - 'wake', - help='wake up a node (or nodes)' + 'on', + help='power on a node (or nodes)' ) p.add_argument ( '--all', action='store_const', const=True, -- 1.8.3.1