Gitweb:
http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=81f9d0...
Commit: 81f9d0ac95b57791b5937ea96fac889e10782d53
Parent: 9e797a89be42e637958ec750e6776441c9557175
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Sun Nov 25 13:26:22 2012 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Sun Nov 25 13:26:22 2012 +0100
fence_lpar: Option 'partion' is moved to fence_lpar
This option was not part of patch a60ed3ca6fa0f63dfb09b46d99c2a281e2eed63e because it will
be replaced
by standard --port / plug option
---
fence/agents/lpar/fence_lpar.py | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py
index 9233003..e8e50c6 100644
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -22,15 +22,15 @@ BUILD_DATE=""
def get_power_status(conn, options):
if options["--hmc-version"] == "3":
- conn.send("lssyscfg -r lpar -m " + options["--managed"] + " -n
" + options["--plug"] + " -F name,state\n")
+ conn.send("lssyscfg -r lpar -m " + options["--managed"] + " -n
" + options["--partition"] + " -F name,state\n")
conn.log_expect(options, options["--command-prompt"],
int(options["--power-timeout"]))
try:
- status = re.compile("^" + options["--plug"] +
",(.*?),.*$", re.IGNORECASE | re.MULTILINE).search(conn.before).group(1)
+ status = re.compile("^" + options["--partition"] +
",(.*?),.*$", re.IGNORECASE | re.MULTILINE).search(conn.before).group(1)
except AttributeError:
fail(EC_STATUS_HMC)
elif options["--hmc-version"] == "4":
- conn.send("lssyscfg -r lpar -m "+ options["--managed"] +"
--filter 'lpar_names=" + options["--plug"] + "'\n")
+ conn.send("lssyscfg -r lpar -m "+ options["--managed"] +"
--filter 'lpar_names=" + options["--partition"] + "'\n")
conn.log_expect(options, options["--command-prompt"],
int(options["--power-timeout"]))
try:
@@ -50,18 +50,18 @@ def get_power_status(conn, options):
def set_power_status(conn, options):
if options["--hmc-version"] == "3":
conn.send("chsysstate -o " + options["--action"] + " -r lpar
-m " + options["--managed"]
- + " -n " + options["--plug"] + "\n")
+ + " -n " + options["--partition"] + "\n")
conn.log_expect(options, options["--command-prompt"],
int(options["--power-timeout"]))
elif options["--hmc-version"] == "4":
if options["--action"] == "on":
conn.send("chsysstate -o on -r lpar -m " + options["--managed"] +
- " -n " + options["--plug"] +
+ " -n " + options["--partition"] +
" -f `lssyscfg -r lpar -F curr_profile " +
" -m " + options["--managed"] +
- " --filter \"lpar_names="+ options["--plug"]
+"\"`\n" )
+ " --filter \"lpar_names="+ options["--partition"]
+"\"`\n" )
else:
conn.send("chsysstate -o shutdown -r lpar --immed" +
- " -m " + options["--managed"] + " -n " +
options["--plug"] + "\n")
+ " -m " + options["--managed"] + " -n " +
options["--partition"] + "\n")
conn.log_expect(options, options["--command-prompt"],
int(options["--power-timeout"]))
def get_lpar_list(conn, options):
@@ -115,6 +115,13 @@ def define_new_opts():
"shortdesc" : "Force HMC version to use (3 or 4)",
"default" : "4",
"order" : 1 }
+ all_opt["partition"] = {
+ "getopt" : "n:",
+ "longopt" : "partition",
+ "help" : "-n <id> Name of the
partition",
+ "required" : "0",
+ "shortdesc" : "Partition name",
+ "order" : 1 }
def main():
device_opt = [ "ipaddr", "ipport", "login",
"passwd", "secure", "cmd_prompt", \
@@ -138,7 +145,7 @@ def main():
if 0 == options.has_key("--managed"):
fail_usage("Failed: You have to enter name of managed system")
- if (0 == ["list",
"monitor"].count(options["--action"].lower())) and (0 ==
options.has_key("--plug")):
+ if (0 == ["list",
"monitor"].count(options["--action"].lower())) and (0 ==
options.has_key("--partition")):
fail_usage("Failed: You have to enter name of the partition")
if 1 == options.has_key("--hmc-version") and
(options["--hmc-version"] != "3" and
options["--hmc-version"] != "4"):