fence-agents: master - [refactor] remove unused variable
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=e8b58b...
Commit: e8b58b335409f4d576a114a7bf5f6ed69065c72f
Parent: ea652f979107bd9f5d7eef00f2652dff07224499
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Dec 3 16:23:03 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Dec 4 22:59:19 2014 +0100
[refactor] remove unused variable
---
fence/agents/lib/fencing.py.py | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index abf5e37..b060de2 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -630,7 +630,6 @@ def process_input(avail_opt):
## Transform short getopt to long one which are used in fencing agents
#####
- old_opt = entered_opt
opt = {}
for o in dict(entered_opt).keys():
if o.startswith("--"):
9 years, 5 months
fence-agents: master - [refactor] Change definition of log_expect() method
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=ea652f...
Commit: ea652f979107bd9f5d7eef00f2652dff07224499
Parent: 7edde18e0de949c7c8b6780b934d3b843749687a
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Dec 3 16:20:22 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Dec 3 16:20:22 2014 +0100
[refactor] Change definition of log_expect() method
Previously, log_expect definition was:
def log_expect(self, options, pattern, timeout):
but the 'options' where not used anywhere and if we will plan to use it in this method,
we already have self.opt available. New method definition is:
def log_expect(self, pattern, timeout):
the rest of this large patch is just removing of options as 1st argument of every call
---
fence/agents/alom/fence_alom.py | 4 +-
fence/agents/apc/fence_apc.py | 38 +++++++++++-----------
fence/agents/bladecenter/fence_bladecenter.py | 16 +++++-----
fence/agents/brocade/fence_brocade.py | 4 +-
fence/agents/drac/fence_drac.py | 4 +-
fence/agents/drac5/fence_drac5.py | 12 +++---
fence/agents/hds_cb/fence_hds_cb.py | 36 +++++++++++-----------
fence/agents/hpblade/fence_hpblade.py | 6 ++--
fence/agents/ilo/fence_ilo.py | 8 ++--
fence/agents/ilo_moonshot/fence_ilo_moonshot.py | 4 +-
fence/agents/ilo_mp/fence_ilo_mp.py | 4 +-
fence/agents/ilo_ssh/fence_ilo_ssh.py | 6 ++--
fence/agents/ldom/fence_ldom.py | 6 ++--
fence/agents/lib/fencing.py.py | 32 +++++++++---------
fence/agents/lpar/fence_lpar.py | 12 +++---
fence/agents/netio/fence_netio.py | 10 +++---
fence/agents/raritan/fence_raritan.py | 8 ++--
fence/agents/rsa/fence_rsa.py | 4 +-
fence/agents/rsb/fence_rsb.py | 14 ++++----
fence/agents/sanbox2/fence_sanbox2.py | 10 +++---
fence/agents/virsh/fence_virsh.py | 6 ++--
fence/agents/wti/fence_wti.py | 12 +++---
22 files changed, 128 insertions(+), 128 deletions(-)
diff --git a/fence/agents/alom/fence_alom.py b/fence/agents/alom/fence_alom.py
index 6b0d03d..1e95ac4 100644
--- a/fence/agents/alom/fence_alom.py
+++ b/fence/agents/alom/fence_alom.py
@@ -18,7 +18,7 @@ BUILD_DATE=""
def get_power_status(conn, options):
conn.send_eol("showplatform")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
status = re.search("standby", conn.before.lower())
result = (status != None and "off" or "on")
@@ -27,7 +27,7 @@ def get_power_status(conn, options):
def set_power_status(conn, options):
cmd_line = (options["--action"] == "on" and "poweron" or "poweroff -f -y")
conn.send_eol(cmd_line)
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
# Get the machine some time between poweron and poweroff
time.sleep(int(options["--power-timeout"]))
diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
index d11bd84..3307e4e 100644
--- a/fence/agents/apc/fence_apc.py
+++ b/fence/agents/apc/fence_apc.py
@@ -31,7 +31,7 @@ def get_power_status(conn, options):
outlets = {}
conn.send_eol("1")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
version = 0
admin = 0
@@ -64,13 +64,13 @@ def get_power_status(conn, options):
conn.send_eol("3")
else:
conn.send_eol("2")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.send_eol("1")
else:
conn.send_eol(options["--switch"])
while True:
- exp_result = conn.log_expect(options,
+ exp_result = conn.log_expect(
["Press <ENTER>"] + options["--command-prompt"], int(options["--shell-timeout"]))
lines = conn.before.split("\n")
show_re = re.compile(r'(^|\x0D)\s*(\d+)- (.*?)\s+(ON|OFF)\s*')
@@ -82,8 +82,8 @@ def get_power_status(conn, options):
if exp_result != 0:
break
conn.send(chr(03))
- conn.log_expect(options, "- Logout", int(options["--shell-timeout"]))
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect("- Logout", int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
if ["list", "monitor"].count(options["--action"]) == 1:
return outlets
@@ -101,7 +101,7 @@ def set_power_status(conn, options):
}[options["--action"]]
conn.send_eol("1")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
version = 0
admin2 = 0
@@ -140,7 +140,7 @@ def set_power_status(conn, options):
conn.send_eol("3")
else:
conn.send_eol("2")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
if None == re.compile('.*2- Outlet Restriction.*', re.IGNORECASE | re.S).match(conn.before):
admin3 = 0
else:
@@ -149,40 +149,40 @@ def set_power_status(conn, options):
else:
conn.send_eol(options["--switch"])
- while 0 == conn.log_expect(options,
+ while 0 == conn.log_expect(
["Press <ENTER>"] + options["--command-prompt"], int(options["--shell-timeout"])):
conn.send_eol("")
conn.send_eol(options["--plug"]+"")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
if switch == 0:
if admin2 == 1:
conn.send_eol("1")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
if admin3 == 1:
conn.send_eol("1")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
else:
conn.send_eol("1")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.send_eol(action)
- conn.log_expect(options, "Enter 'YES' to continue or <ENTER> to cancel :", int(options["--shell-timeout"]))
+ conn.log_expect("Enter 'YES' to continue or <ENTER> to cancel :", int(options["--shell-timeout"]))
conn.send_eol("YES")
- conn.log_expect(options, "Press <ENTER> to continue...", int(options["--power-timeout"]))
+ conn.log_expect("Press <ENTER> to continue...", int(options["--power-timeout"]))
conn.send_eol("")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
conn.send(chr(03))
- conn.log_expect(options, "- Logout", int(options["--shell-timeout"]))
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect("- Logout", int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
def get_power_status5(conn, options):
outlets = {}
conn.send_eol("olStatus all")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
lines = conn.before.split("\n")
show_re = re.compile(r'^\s*(\d+): (.*): (On|Off)\s*$', re.IGNORECASE)
@@ -208,7 +208,7 @@ def set_power_status5(conn, options):
}[options["--action"]]
conn.send_eol(action + " " + options["--plug"])
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
def main():
device_opt = ["ipaddr", "login", "passwd", "cmd_prompt", "secure", \
diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
index 314ced3..38604d5 100644
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -28,7 +28,7 @@ def get_power_status(conn, options):
node_cmd = r"system:blade\[" + options["--plug"] + r"\]>"
conn.send_eol("env -T system:blade[" + options["--plug"] + "]")
- i = conn.log_expect(options, [node_cmd, "system>"], int(options["--shell-timeout"]))
+ i = conn.log_expect([node_cmd, "system>"], int(options["--shell-timeout"]))
if i == 1:
## Given blade number does not exist
if options.has_key("--missing-as-off"):
@@ -36,10 +36,10 @@ def get_power_status(conn, options):
else:
fail(EC_STATUS)
conn.send_eol("power -state")
- conn.log_expect(options, node_cmd, int(options["--shell-timeout"]))
+ conn.log_expect(node_cmd, int(options["--shell-timeout"]))
status = conn.before.splitlines()[-1]
conn.send_eol("env -T system")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
return status.lower().strip()
@@ -47,7 +47,7 @@ def set_power_status(conn, options):
node_cmd = r"system:blade\[" + options["--plug"] + r"\]>"
conn.send_eol("env -T system:blade[" + options["--plug"] + "]")
- i = conn.log_expect(options, [node_cmd, "system>"], int(options["--shell-timeout"]))
+ i = conn.log_expect([node_cmd, "system>"], int(options["--shell-timeout"]))
if i == 1:
## Given blade number does not exist
if options.has_key("--missing-as-off"):
@@ -56,9 +56,9 @@ def set_power_status(conn, options):
fail(EC_GENERIC_ERROR)
conn.send_eol("power -"+options["--action"])
- conn.log_expect(options, node_cmd, int(options["--shell-timeout"]))
+ conn.log_expect(node_cmd, int(options["--shell-timeout"]))
conn.send_eol("env -T system")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
def get_blades_list(conn, options):
outlets = {}
@@ -66,9 +66,9 @@ def get_blades_list(conn, options):
node_cmd = "system>"
conn.send_eol("env -T system")
- conn.log_expect(options, node_cmd, int(options["--shell-timeout"]))
+ conn.log_expect(node_cmd, int(options["--shell-timeout"]))
conn.send_eol("list -l 2")
- conn.log_expect(options, node_cmd, int(options["--shell-timeout"]))
+ conn.log_expect(node_cmd, int(options["--shell-timeout"]))
lines = conn.before.split("\r\n")
filter_re = re.compile(r"^\s*blade\[(\d+)\]\s+(.*?)\s*$")
diff --git a/fence/agents/brocade/fence_brocade.py b/fence/agents/brocade/fence_brocade.py
index 54c5920..e5a5063 100644
--- a/fence/agents/brocade/fence_brocade.py
+++ b/fence/agents/brocade/fence_brocade.py
@@ -19,7 +19,7 @@ def set_power_status(conn, options):
}[options["--action"]]
conn.send_eol(action + " " + options["--plug"])
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
def get_power_status(conn, options):
line_re = re.compile(r'=========', re.IGNORECASE)
@@ -27,7 +27,7 @@ def get_power_status(conn, options):
in_index = False
conn.send_eol("switchshow")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
for line in str(conn.before).split("\n"):
if line_re.search(line):
in_index = True
diff --git a/fence/agents/drac/fence_drac.py b/fence/agents/drac/fence_drac.py
index 4428fb7..2bac539 100644
--- a/fence/agents/drac/fence_drac.py
+++ b/fence/agents/drac/fence_drac.py
@@ -13,7 +13,7 @@ BUILD_DATE=""
def get_power_status(conn, options):
conn.send_eol("getmodinfo")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
status = re.compile(r"\s+(on|off)\s+", re.IGNORECASE).search(conn.before).group(1)
return status.lower().strip()
@@ -24,7 +24,7 @@ def set_power_status(conn, options):
}[options["--action"]]
conn.send_eol("serveraction -d 0 " + action)
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
def main():
device_opt = ["ipaddr", "login", "passwd", "cmd_prompt", "telnet"]
diff --git a/fence/agents/drac5/fence_drac5.py b/fence/agents/drac5/fence_drac5.py
index 0c9ced6..070fe41 100644
--- a/fence/agents/drac5/fence_drac5.py
+++ b/fence/agents/drac5/fence_drac5.py
@@ -33,7 +33,7 @@ def get_power_status(conn, options):
elif options["--drac-version"] == "DRAC 5":
conn.send_eol("racadm serveraction powerstatus")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
status = re.compile(r"(^|: )(ON|OFF|Powering ON|Powering OFF)\s*$",
re.IGNORECASE | re.MULTILINE).search(conn.before).group(2)
@@ -58,11 +58,11 @@ def set_power_status(conn, options):
## Fix issue with double-enter [CR/LF]
## We need to read two additional command prompts (one from get + one from set command)
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
if len(conn.before.strip()) == 0:
options["eol"] = options["eol"][:-1]
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
def get_list_devices(conn, options):
outlets = {}
@@ -71,7 +71,7 @@ def get_list_devices(conn, options):
conn.send_eol("getmodinfo")
list_re = re.compile(r"^([^\s]*?)\s+Present\s*(ON|OFF)\s*.*$")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
for line in conn.before.splitlines():
if list_re.search(line):
outlets[list_re.search(line).group(1)] = ("", list_re.search(line).group(2))
@@ -79,7 +79,7 @@ def get_list_devices(conn, options):
conn.send_eol("getmodinfo")
list_re = re.compile(r"^\s*([^\s]*)\s*---->\s*(.*?)\s+Present\s*(ON|OFF)\s*.*$")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
for line in conn.before.splitlines():
if list_re.search(line):
outlets[list_re.search(line).group(2)] = ("", list_re.search(line).group(3))
diff --git a/fence/agents/hds_cb/fence_hds_cb.py b/fence/agents/hds_cb/fence_hds_cb.py
index b3d725a..5de8e2a 100755
--- a/fence/agents/hds_cb/fence_hds_cb.py
+++ b/fence/agents/hds_cb/fence_hds_cb.py
@@ -27,9 +27,9 @@ def get_power_status(conn, options):
#### Maybe should put a conn.log_expect here to make sure
#### we have properly entered into the main menu
conn.sendline("S") # Enter System Command Mode
- conn.log_expect(options, "SVP>", int(options["--shell-timeout"]))
+ conn.log_expect("SVP>", int(options["--shell-timeout"]))
conn.sendline("PC") # Enter partition control
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
result = {}
# Status can now be obtained from the output of the PC
# command. Line looks like the following:
@@ -49,9 +49,9 @@ def get_power_status(conn, options):
# the partition control, but the logic is a little cleaner
# this way.
conn.sendline("Q") # Back to system command mode
- conn.log_expect(options, "SVP>", int(options["--shell-timeout"]))
+ conn.log_expect("SVP>", int(options["--shell-timeout"]))
conn.sendline("EX") # Back to system console main menu
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
return result
@@ -63,33 +63,33 @@ def set_power_status(conn, options):
}[options["--action"]]
conn.sendline("S") # Enter System Command Mode
- conn.log_expect(options, "SVP>", int(options["--shell-timeout"]))
+ conn.log_expect("SVP>", int(options["--shell-timeout"]))
conn.sendline("PC") # Enter partition control
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.sendline("P") # Enter power control menu
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.sendline(action) # Execute action from array above
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.sendline(options["--plug"]) # Select blade number from args
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.sendline("Y") # Confirm action
- conn.log_expect(options, "Hit enter key.", int(options["--shell-timeout"]))
+ conn.log_expect("Hit enter key.", int(options["--shell-timeout"]))
conn.sendline("") # Press the any key
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.sendline("Q") # Quit back to partition control
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.sendline("Q") # Quit back to system command mode
- conn.log_expect(options, "SVP>", int(options["--shell-timeout"]))
+ conn.log_expect("SVP>", int(options["--shell-timeout"]))
conn.sendline("EX") # Quit back to system console menu
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
def get_blades_list(conn, options):
outlets = {}
conn.sendline("S") # Enter System Command Mode
- conn.log_expect(options, "SVP>", int(options["--shell-timeout"]))
+ conn.log_expect("SVP>", int(options["--shell-timeout"]))
conn.sendline("PC") # Enter partition control
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
# Status can now be obtained from the output of the PC
# command. Line looks like the following:
# "P Power Condition LID lamp Mode Auto power on"
@@ -100,9 +100,9 @@ def get_blades_list(conn, options):
if partition != None:
outlets[partition.group(1)] = (partition.group(2), "")
conn.sendline("Q") # Quit back to system command mode
- conn.log_expect(options, "SVP>", int(options["--shell-timeout"]))
+ conn.log_expect("SVP>", int(options["--shell-timeout"]))
conn.sendline("EX") # Quit back to system console menu
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
return outlets
diff --git a/fence/agents/hpblade/fence_hpblade.py b/fence/agents/hpblade/fence_hpblade.py
index 118dd7f..e73a6c3 100644
--- a/fence/agents/hpblade/fence_hpblade.py
+++ b/fence/agents/hpblade/fence_hpblade.py
@@ -20,7 +20,7 @@ BUILD_DATE="March, 2008"
def get_power_status(conn, options):
conn.send_eol("show server status " + options["--plug"])
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
power_re = re.compile(r"^\s*Power: (.*?)\s*$")
status = "unknown"
@@ -42,13 +42,13 @@ def set_power_status(conn, options):
conn.send_eol("poweron server " + options["--plug"])
elif options["--action"] == "off":
conn.send_eol("poweroff server " + options["--plug"] + " force")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
def get_blades_list(conn, options):
outlets = {}
conn.send_eol("show server list")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
list_re = re.compile(r"^\s*(.*?)\s+(.*?)\s+(.*?)\s+OK\s+(.*?)\s+(.*?)\s*$")
for line in conn.before.splitlines():
diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
index 965aabf..46650bd 100644
--- a/fence/agents/ilo/fence_ilo.py
+++ b/fence/agents/ilo/fence_ilo.py
@@ -29,7 +29,7 @@ def get_power_status(conn, options):
" PASSWORD = " + quoteattr(options["--password"]) + ">\r\n")
conn.send("<SERVER_INFO MODE = \"read\"><GET_HOST_POWER_STATUS/>\r\n")
conn.send("</SERVER_INFO></LOGIN>\r\n")
- conn.log_expect(options, "HOST_POWER=\"(.*?)\"", int(options["--power-timeout"]))
+ conn.log_expect("HOST_POWER=\"(.*?)\"", int(options["--power-timeout"]))
status = conn.match.group(1)
return status.lower().strip()
@@ -94,7 +94,7 @@ the iLO card through an XML stream."
conn = fence_login(options)
try:
conn.send("<?xml version=\"1.0\"?>\r\n")
- conn.log_expect(options, ["</RIBCL>", "<END_RIBCL/>"], int(options["--login-timeout"]))
+ conn.log_expect(["</RIBCL>", "<END_RIBCL/>"], int(options["--login-timeout"]))
version = re.compile("<RIBCL VERSION=\"(.*?)\"", re.IGNORECASE).search(conn.before).group(1)
if not options.has_key("--ribcl-version"):
options["--ribcl-version"] = float(version)
@@ -109,8 +109,8 @@ the iLO card through an XML stream."
if options["--ribcl-version"] >= 2:
conn.send("<RIB_INFO MODE=\"read\"><GET_FW_VERSION />\r\n")
conn.send("</RIB_INFO>\r\n")
- conn.log_expect(options, r"<GET_FW_VERSION\s*\n", int(options["--shell-timeout"]))
- conn.log_expect(options, "/>", int(options["--shell-timeout"]))
+ conn.log_expect(r"<GET_FW_VERSION\s*\n", int(options["--shell-timeout"]))
+ conn.log_expect("/>", int(options["--shell-timeout"]))
options["fw_version"] = float(re.compile(r"FIRMWARE_VERSION\s*=\s*\"(.*?)\"",
re.IGNORECASE).search(conn.before).group(1))
options["fw_processor"] = re.compile(r"MANAGEMENT_PROCESSOR\s*=\s*\"(.*?)\"",
diff --git a/fence/agents/ilo_moonshot/fence_ilo_moonshot.py b/fence/agents/ilo_moonshot/fence_ilo_moonshot.py
index b9b4559..e161ac6 100644
--- a/fence/agents/ilo_moonshot/fence_ilo_moonshot.py
+++ b/fence/agents/ilo_moonshot/fence_ilo_moonshot.py
@@ -14,7 +14,7 @@ BUILD_DATE=""
def get_power_status(conn, options):
conn.send_eol("show node list")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
nodes = {}
for line in conn.before.splitlines():
@@ -36,7 +36,7 @@ def set_power_status(conn, options):
else:
conn.send_eol("set node power off force %s" % (options["--plug"]))
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
return
diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py
index 7195bdd..396d1a9 100644
--- a/fence/agents/ilo_mp/fence_ilo_mp.py
+++ b/fence/agents/ilo_mp/fence_ilo_mp.py
@@ -15,7 +15,7 @@ def get_power_status(conn, options):
conn.send_eol("show /system1")
re_state = re.compile('EnabledState=(.*)', re.IGNORECASE)
- conn.log_expect(options, re_state, int(options["--shell-timeout"]))
+ conn.log_expect(re_state, int(options["--shell-timeout"]))
status = conn.match.group(1).lower()
@@ -30,7 +30,7 @@ def set_power_status(conn, options):
else:
conn.send_eol("stop -f /system1")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
return
diff --git a/fence/agents/ilo_ssh/fence_ilo_ssh.py b/fence/agents/ilo_ssh/fence_ilo_ssh.py
index 7451792..a510b2e 100644
--- a/fence/agents/ilo_ssh/fence_ilo_ssh.py
+++ b/fence/agents/ilo_ssh/fence_ilo_ssh.py
@@ -15,7 +15,7 @@ def get_power_status(conn, options):
conn.send_eol("show /system1")
re_state = re.compile('EnabledState=(.*)', re.IGNORECASE)
- conn.log_expect(options, re_state, int(options["--shell-timeout"]))
+ conn.log_expect(re_state, int(options["--shell-timeout"]))
status = conn.match.group(1).lower()
@@ -30,13 +30,13 @@ def set_power_status(conn, options):
else:
conn.send_eol("power off hard")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
return
def reboot_cycle(conn, options):
conn.send_eol("reset hard /system1")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
return
def main():
diff --git a/fence/agents/ldom/fence_ldom.py b/fence/agents/ldom/fence_ldom.py
index af4e974..27a1a4a 100644
--- a/fence/agents/ldom/fence_ldom.py
+++ b/fence/agents/ldom/fence_ldom.py
@@ -29,14 +29,14 @@ def start_communication(conn, options):
if res == 0:
#CSH stuff
conn.send_eol("set prompt='" + COMMAND_PROMPT_NEW + "'")
- conn.log_expect(options, COMMAND_PROMPT_REG, int(options["--shell-timeout"]))
+ conn.log_expect(COMMAND_PROMPT_REG, int(options["--shell-timeout"]))
def get_power_status(conn, options):
start_communication(conn, options)
conn.send_eol("ldm ls")
- conn.log_expect(options, COMMAND_PROMPT_REG, int(options["--shell-timeout"]))
+ conn.log_expect(COMMAND_PROMPT_REG, int(options["--shell-timeout"]))
result = {}
@@ -67,7 +67,7 @@ def set_power_status(conn, options):
conn.send_eol(cmd_line)
- conn.log_expect(options, COMMAND_PROMPT_REG, int(options["--power-timeout"]))
+ conn.log_expect(COMMAND_PROMPT_REG, int(options["--power-timeout"]))
def main():
device_opt = ["ipaddr", "login", "passwd", "cmd_prompt", "secure", "port"]
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index caa3e2d..abf5e37 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -444,7 +444,7 @@ class fspawn(pexpect.spawn):
pexpect.spawn.__init__(self, command)
self.opt = options
- def log_expect(self, options, pattern, timeout):
+ def log_expect(self, pattern, timeout):
result = self.expect(pattern, timeout)
logging.debug("Received: %s", self.before + self.after)
return result
@@ -1057,25 +1057,25 @@ def fence_login(options, re_login_string=r"(login\s*: )|((?!Last )Login Name: )
if options.has_key("telnet_over_ssh"):
# This is for stupid ssh servers (like ALOM) which behave more like telnet
# (ignore name and display login prompt)
- result = conn.log_expect(options, \
+ result = conn.log_expect( \
[re_login, "Are you sure you want to continue connecting (yes/no)?"],
int(options["--login-timeout"]))
if result == 1:
conn.sendline("yes") # Host identity confirm
- conn.log_expect(options, re_login, int(options["--login-timeout"]))
+ conn.log_expect(re_login, int(options["--login-timeout"]))
conn.sendline(options["--username"])
- conn.log_expect(options, re_pass, int(options["--login-timeout"]))
+ conn.log_expect(re_pass, int(options["--login-timeout"]))
else:
- result = conn.log_expect(options, \
+ result = conn.log_expect( \
["ssword:", "Are you sure you want to continue connecting (yes/no)?"],
int(options["--login-timeout"]))
if result == 1:
conn.sendline("yes")
- conn.log_expect(options, "ssword:", int(options["--login-timeout"]))
+ conn.log_expect("ssword:", int(options["--login-timeout"]))
conn.sendline(options["--password"])
- conn.log_expect(options, options["--command-prompt"], int(options["--login-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--login-timeout"]))
elif options.has_key("--ssh") and options.has_key("--identity-file"):
command = '%s %s %s@%s -i %s -p %s' % \
(options["--ssh-path"], force_ipvx, options["--username"], options["--ip"], \
@@ -1085,18 +1085,18 @@ def fence_login(options, re_login_string=r"(login\s*: )|((?!Last )Login Name: )
conn = fspawn(options, command)
- result = conn.log_expect(options, ["Enter passphrase for key '" + options["--identity-file"] + "':", \
+ result = conn.log_expect(["Enter passphrase for key '" + options["--identity-file"] + "':", \
"Are you sure you want to continue connecting (yes/no)?"] + \
options["--command-prompt"], int(options["--login-timeout"]))
if result == 1:
conn.sendline("yes")
- result = conn.log_expect(options,
+ result = conn.log_expect(
["Enter passphrase for key '" + options["--identity-file"]+"':"] + \
options["--command-prompt"], int(options["--login-timeout"]))
if result == 0:
if options.has_key("--password"):
conn.sendline(options["--password"])
- conn.log_expect(options, options["--command-prompt"], int(options["--login-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--login-timeout"]))
else:
fail_usage("Failed: You have to enter passphrase (-p) for identity file")
else:
@@ -1104,7 +1104,7 @@ def fence_login(options, re_login_string=r"(login\s*: )|((?!Last )Login Name: )
conn.send("set binary\n")
conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
- result = conn.log_expect(options, re_login, int(options["--login-timeout"]))
+ result = conn.log_expect(re_login, int(options["--login-timeout"]))
conn.send_eol(options["--username"])
## automatically change end of line separator
@@ -1112,13 +1112,13 @@ def fence_login(options, re_login_string=r"(login\s*: )|((?!Last )Login Name: )
if re_login.search(screen) != None:
options["eol"] = "\n"
conn.send_eol(options["--username"])
- result = conn.log_expect(options, re_pass, int(options["--login-timeout"]))
+ result = conn.log_expect(re_pass, int(options["--login-timeout"]))
elif re_pass.search(screen) != None:
- conn.log_expect(options, re_pass, int(options["--shell-timeout"]))
+ conn.log_expect(re_pass, int(options["--shell-timeout"]))
try:
conn.send_eol(options["--password"])
- valid_password = conn.log_expect(options, [re_login] + \
+ valid_password = conn.log_expect([re_login] + \
options["--command-prompt"], int(options["--shell-timeout"]))
if valid_password == 0:
## password is invalid or we have to change EOL separator
@@ -1129,9 +1129,9 @@ def fence_login(options, re_login_string=r"(login\s*: )|((?!Last )Login Name: )
if re_login.search(screen) != None:
conn.send_eol("")
conn.send_eol(options["--username"])
- conn.log_expect(options, re_pass, int(options["--login-timeout"]))
+ conn.log_expect(re_pass, int(options["--login-timeout"]))
conn.send_eol(options["--password"])
- conn.log_expect(options, options["--command-prompt"], int(options["--login-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--login-timeout"]))
except KeyError:
fail(EC_PASSWORD_MISSING)
except pexpect.EOF:
diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py
index 31b0521..caa7d38 100644
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -25,7 +25,7 @@ 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.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
try:
status = re.compile("^" + options["--plug"] + ",(.*?),.*$",
@@ -35,7 +35,7 @@ def get_power_status(conn, options):
elif options["--hmc-version"] == "4":
conn.send("lssyscfg -r lpar -m "+ options["--managed"] +
" --filter 'lpar_names=" + options["--plug"] + "'\n")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
try:
status = re.compile(",state=(.*?),", re.IGNORECASE).search(conn.before).group(1)
@@ -55,7 +55,7 @@ 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")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(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"] +
@@ -66,13 +66,13 @@ def set_power_status(conn, options):
else:
conn.send("chsysstate -o shutdown -r lpar --immed" +
" -m " + options["--managed"] + " -n " + options["--plug"] + "\n")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
def get_lpar_list(conn, options):
outlets = {}
if options["--hmc-version"] == "3":
conn.send("query_partition_names -m " + options["--managed"] + "\n")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
## We have to remove first 3 lines (command + header) and last line (part of new prompt)
####
@@ -87,7 +87,7 @@ def get_lpar_list(conn, options):
elif options["--hmc-version"] == "4":
conn.send("lssyscfg -r lpar -m " + options["--managed"] +
" -F name:state\n")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
## We have to remove first line (command) and last line (part of new prompt)
####
diff --git a/fence/agents/netio/fence_netio.py b/fence/agents/netio/fence_netio.py
index 6f34c92..1a37206 100755
--- a/fence/agents/netio/fence_netio.py
+++ b/fence/agents/netio/fence_netio.py
@@ -15,7 +15,7 @@ BUILD_DATE=""
def get_power_status(conn, options):
conn.send_eol("port %s" % options["--plug"])
re_status = re.compile("250 [01imt]")
- conn.log_expect(options, re_status, int(options["--shell-timeout"]))
+ conn.log_expect(re_status, int(options["--shell-timeout"]))
status = {
"0" : "off",
"1" : "on",
@@ -34,7 +34,7 @@ def set_power_status(conn, options):
}[options["--action"]]
conn.send_eol("port %s %s" % (options["--plug"], action))
- conn.log_expect(options, "250 OK", int(options["--shell-timeout"]))
+ conn.log_expect("250 OK", int(options["--shell-timeout"]))
def get_outlet_list(conn, options):
result = {}
@@ -43,7 +43,7 @@ def get_outlet_list(conn, options):
# the NETIO-230B has 4 ports, counting start at 1
for plug in ["1", "2", "3", "4"]:
conn.send_eol("port setup %s" % plug)
- conn.log_expect(options, "250 .+", int(options["--shell-timeout"]))
+ conn.log_expect("250 .+", int(options["--shell-timeout"]))
# the name is enclosed in "", drop those with [1:-1]
name = conn.after.split()[1][1:-1]
result[plug] = (name, "unknown")
@@ -87,9 +87,9 @@ block any necessary fencing actions."
conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
conn.read_nonblocking(size=100, timeout=int(options["--shell-timeout"]))
- conn.log_expect(options, "100 HELLO .*", int(options["--shell-timeout"]))
+ conn.log_expect("100 HELLO .*", int(options["--shell-timeout"]))
conn.send_eol("login %s %s" % (options["--username"], options["--password"]))
- conn.log_expect(options, "250 OK", int(options["--shell-timeout"]))
+ conn.log_expect("250 OK", int(options["--shell-timeout"]))
except pexpect.EOF:
fail(EC_LOGIN_DENIED)
except pexpect.TIMEOUT:
diff --git a/fence/agents/raritan/fence_raritan.py b/fence/agents/raritan/fence_raritan.py
index 1d674ad..502742e 100644
--- a/fence/agents/raritan/fence_raritan.py
+++ b/fence/agents/raritan/fence_raritan.py
@@ -18,7 +18,7 @@ BUILD_DATE=""
def get_power_status(conn, options):
conn.send_eol("show -d properties=powerState %s" % options["--plug"])
re_status = re.compile(".*powerState is [12].*")
- conn.log_expect(options, re_status, int(options["--shell-timeout"]))
+ conn.log_expect(re_status, int(options["--shell-timeout"]))
status = {
#"0" : "off",
"1" : "on",
@@ -69,11 +69,11 @@ block any necessary fencing actions."
conn.send("set binary\n")
conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
conn.read_nonblocking(size=100, timeout=int(options["--shell-timeout"]))
- conn.log_expect(options, "Login.*", int(options["--shell-timeout"]))
+ conn.log_expect("Login.*", int(options["--shell-timeout"]))
conn.send_eol("%s" % (options["--username"]))
- conn.log_expect(options, "Password.*", int(options["--shell-timeout"]))
+ conn.log_expect("Password.*", int(options["--shell-timeout"]))
conn.send_eol("%s" % (options["--password"]))
- conn.log_expect(options, "clp.*", int(options["--shell-timeout"]))
+ conn.log_expect("clp.*", int(options["--shell-timeout"]))
except pexpect.EOF:
fail(EC_LOGIN_DENIED)
except pexpect.TIMEOUT:
diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py
index 6bb4989..46f4bb9 100644
--- a/fence/agents/rsa/fence_rsa.py
+++ b/fence/agents/rsa/fence_rsa.py
@@ -20,7 +20,7 @@ BUILD_DATE=""
def get_power_status(conn, options):
conn.send_eol("power state")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
match = re.compile("Power: (.*)", re.IGNORECASE).search(conn.before)
if match != None:
@@ -32,7 +32,7 @@ def get_power_status(conn, options):
def set_power_status(conn, options):
conn.send_eol("power " + options["--action"])
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
def main():
device_opt = ["ipaddr", "login", "passwd", "cmd_prompt", "secure", "telnet"]
diff --git a/fence/agents/rsb/fence_rsb.py b/fence/agents/rsb/fence_rsb.py
index 0058ac8..73941b6 100755
--- a/fence/agents/rsb/fence_rsb.py
+++ b/fence/agents/rsb/fence_rsb.py
@@ -13,10 +13,10 @@ BUILD_DATE=""
def get_power_status(conn, options):
conn.send("2")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
status = re.compile(r"Power Status[\s]*: (on|off)", re.IGNORECASE).search(conn.before).group(1)
conn.send("0")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
return status.lower().strip()
@@ -27,16 +27,16 @@ def set_power_status(conn, options):
}[options["--action"]]
conn.send("2")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.send_eol(action)
- conn.log_expect(options, ["want to power " + options["--action"],
+ conn.log_expect(["want to power " + options["--action"],
"yes/no", "'yes' or 'no'"], int(options["--shell-timeout"]))
conn.send_eol("yes")
- conn.log_expect(options, "any key to continue", int(options["--power-timeout"]))
+ conn.log_expect("any key to continue", int(options["--power-timeout"]))
conn.send_eol("")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
conn.send_eol("0")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
def main():
device_opt = ["ipaddr", "login", "passwd", "secure", "cmd_prompt", "telnet"]
diff --git a/fence/agents/sanbox2/fence_sanbox2.py b/fence/agents/sanbox2/fence_sanbox2.py
index 1a041cf..efa7dc8 100644
--- a/fence/agents/sanbox2/fence_sanbox2.py
+++ b/fence/agents/sanbox2/fence_sanbox2.py
@@ -28,7 +28,7 @@ def get_power_status(conn, options):
}
try:
conn.send_eol("show port " + options["--plug"])
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
except pexpect.TIMEOUT:
try:
conn.send_eol("admin end")
@@ -54,7 +54,7 @@ def set_power_status(conn, options):
try:
conn.send_eol("set port " + options["--plug"] + " state " + action)
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
except pexpect.TIMEOUT:
try:
conn.send_eol("admin end")
@@ -66,7 +66,7 @@ def set_power_status(conn, options):
try:
conn.send_eol("set port " + options["--plug"] + " state " + action)
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
except pexpect.TIMEOUT:
try:
conn.send_eol("admin end")
@@ -81,7 +81,7 @@ def get_list_devices(conn, options):
try:
conn.send_eol("show port")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
list_re = re.compile(r"^\s+(\d+?)\s+(Online|Offline)\s+", re.IGNORECASE)
for line in conn.before.splitlines():
@@ -129,7 +129,7 @@ because the connection will block any necessary fencing actions."
conn = fence_login(options)
conn.send_eol("admin start")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
if re.search(r"\(admin\)", conn.before, re.MULTILINE) == None:
## Someone else is in admin section, we can't enable/disable
diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py
index b351834..d3dd8fc 100644
--- a/fence/agents/virsh/fence_virsh.py
+++ b/fence/agents/virsh/fence_virsh.py
@@ -28,7 +28,7 @@ def get_outlets_status(conn, options):
prefix = ""
conn.sendline(prefix + "virsh list --all")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
result = {}
@@ -49,7 +49,7 @@ def get_outlets_status(conn, options):
def get_power_status(conn, options):
prefix = options["--sudo-path"] + " " if options.has_key("--use-sudo") else ""
conn.sendline(prefix + "virsh domstate %s" % (get_name_or_uuid(options)))
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
for line in conn.before.splitlines():
if line.strip() in ["running", "blocked", "idle", "no state", "paused"]:
@@ -64,7 +64,7 @@ def set_power_status(conn, options):
conn.sendline(prefix + "virsh %s " %
(options["--action"] == "on" and "start" or "destroy") + get_name_or_uuid(options))
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
time.sleep(int(options["--power-wait"]))
def main():
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index e669f20..f4ab51b 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -36,11 +36,11 @@ def get_listing(conn, options, listing_command):
re_next = re.compile("Enter: ", re.IGNORECASE)
re_all.append(re_next)
- result = conn.log_expect(options, re_all, int(options["--shell-timeout"]))
+ result = conn.log_expect(re_all, int(options["--shell-timeout"]))
listing = conn.before
if result == (len(re_all) - 1):
conn.send_eol("")
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
listing += conn.before
return listing
@@ -175,7 +175,7 @@ def set_power_status(conn, options):
}[options["--action"]]
conn.send_eol(action + " " + options["--plug"] + ",y")
- conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--power-timeout"]))
def main():
device_opt = ["ipaddr", "login", "passwd", "no_login", "no_password", \
@@ -216,18 +216,18 @@ is running because the connection will block any necessary fencing actions."
re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE)
re_prompt = re.compile("|".join(["(" + x + ")" for x in options["--command-prompt"]]), re.IGNORECASE)
- result = conn.log_expect(options, [re_login, "Password: ", re_prompt], int(options["--shell-timeout"]))
+ result = conn.log_expect([re_login, "Password: ", re_prompt], int(options["--shell-timeout"]))
if result == 0:
if options.has_key("--username"):
conn.send_eol(options["--username"])
- result = conn.log_expect(options, [re_login, "Password: ", re_prompt], int(options["--shell-timeout"]))
+ result = conn.log_expect([re_login, "Password: ", re_prompt], int(options["--shell-timeout"]))
else:
fail_usage("Failed: You have to set login name")
if result == 1:
if options.has_key("--password"):
conn.send_eol(options["--password"])
- conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
else:
fail_usage("Failed: You have to enter password or password script")
except pexpect.EOF:
9 years, 5 months
fence-agents: master - [refactor] Fix issues according to pylint
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=7edde1...
Commit: 7edde18e0de949c7c8b6780b934d3b843749687a
Parent: 7b4c83bcd0123d177725b7b8c72fbf811fdf01cd
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Dec 3 15:57:32 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Dec 3 15:57:32 2014 +0100
[refactor] Fix issues according to pylint
---
fence/agents/lib/fencing.py.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index cf72ed7..caa3e2d 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -624,7 +624,7 @@ def process_input(avail_opt):
#####
if len(sys.argv) > 1:
try:
- obtained_opt = getopt.gnu_getopt(sys.argv[1:], getopt_string, longopt_list)[0]
+ entered_opt = getopt.gnu_getopt(sys.argv[1:], getopt_string, longopt_list)[0]
except getopt.GetoptError, error:
fail_usage("Parse error: " + error.msg)
9 years, 5 months
fence-agents: master - [refactor] Fix issues according to pylint
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=7b4c83...
Commit: 7b4c83bcd0123d177725b7b8c72fbf811fdf01cd
Parent: 9c837a80ad8a8ad8cd6e2484507037cf0685fdf7
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Dec 3 15:52:52 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Dec 3 15:52:52 2014 +0100
[refactor] Fix issues according to pylint
---
fence/agents/lib/fencing.py.py | 57 +++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 302bba2..cf72ed7 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -624,25 +624,25 @@ def process_input(avail_opt):
#####
if len(sys.argv) > 1:
try:
- opt, _args = getopt.gnu_getopt(sys.argv[1:], getopt_string, longopt_list)
+ obtained_opt = getopt.gnu_getopt(sys.argv[1:], getopt_string, longopt_list)[0]
except getopt.GetoptError, error:
fail_usage("Parse error: " + error.msg)
## Transform short getopt to long one which are used in fencing agents
#####
- old_opt = opt
+ old_opt = entered_opt
opt = {}
- for o in dict(old_opt).keys():
+ for o in dict(entered_opt).keys():
if o.startswith("--"):
for x in all_opt.keys():
if all_opt[x].has_key("longopt") and "--" + all_opt[x]["longopt"] == o:
- opt["--" + all_opt[x]["longopt"]] = dict(old_opt)[o]
+ opt["--" + all_opt[x]["longopt"]] = dict(entered_opt)[o]
else:
for x in all_opt.keys():
if x in avail_opt and all_opt[x].has_key("getopt") and all_opt[x].has_key("longopt") and \
("-" + all_opt[x]["getopt"] == o or "-" + all_opt[x]["getopt"].rstrip(":") == o):
- opt["--" + all_opt[x]["longopt"]] = dict(old_opt)[o]
- opt[o] = dict(old_opt)[o]
+ opt["--" + all_opt[x]["longopt"]] = dict(entered_opt)[o]
+ opt[o] = dict(entered_opt)[o]
## Compatibility Layer
#####
@@ -715,10 +715,13 @@ def check_input(device_opt, opt):
elif device_opt.count("snmp_version"):
all_opt["ipport"]["default"] = "161"
all_opt["ipport"]["help"] = "-u, --ipport=[port] TCP/UDP port to use (default 161)"
- elif options.has_key("--ssh") or (all_opt["secure"].has_key("default") and all_opt["secure"]["default"] == '1'):
+ elif options.has_key("--ssh") or \
+ (all_opt["secure"].has_key("default") and all_opt["secure"]["default"] == '1'):
all_opt["ipport"]["default"] = 22
all_opt["ipport"]["help"] = "-u, --ipport=[port] TCP/UDP port to use (default 22)"
- elif options.has_key("--ssl") or options.has_key("--ssl-secure") or options.has_key("--ssl-insecure") or (all_opt["ssl"].has_key("default") and all_opt["ssl"]["default"] == '1'):
+ elif options.has_key("--ssl") or options.has_key("--ssl-secure") or \
+ options.has_key("--ssl-insecure") or \
+ (all_opt["ssl"].has_key("default") and all_opt["ssl"]["default"] == '1'):
all_opt["ipport"]["default"] = 443
all_opt["ipport"]["help"] = "-u, --ipport=[port] TCP/UDP port to use (default 443)"
elif device_opt.count("web"):
@@ -814,9 +817,9 @@ def check_input(device_opt, opt):
if options.has_key("--debug-file"):
try:
- fh = logging.FileHandler(options["--debug-file"])
- fh.setLevel(logging.DEBUG)
- logging.getLogger().addHandler(fh)
+ debug_file = logging.FileHandler(options["--debug-file"])
+ debug_file.setLevel(logging.DEBUG)
+ logging.getLogger().addHandler(debug_file)
except IOError:
logging.error("Unable to create file %s", options["--debug-file"])
fail_usage("Failed: Unable to create file " + options["--debug-file"])
@@ -844,7 +847,7 @@ def check_input(device_opt, opt):
## Obtain a power status from possibly more than one plug
## "on" is returned if at least one plug is ON
######
-def get_multi_power_fn(tn, options, get_power_fn):
+def get_multi_power_fn(connection, options, get_power_fn):
status = "off"
plugs = options["--plugs"] if options.has_key("--plugs") else [""]
@@ -857,13 +860,13 @@ def get_multi_power_fn(tn, options, get_power_fn):
pass
options["--plug"] = plug
- plug_status = get_power_fn(tn, options)
+ plug_status = get_power_fn(connection, options)
if plug_status != "off":
status = plug_status
return status
-def set_multi_power_fn(tn, options, set_power_fn, get_power_fn, retry_attempts = 1):
+def set_multi_power_fn(connection, options, set_power_fn, get_power_fn, retry_attempts=1):
plugs = options["--plugs"] if options.has_key("--plugs") else [""]
for _ in range(retry_attempts):
@@ -876,11 +879,11 @@ def set_multi_power_fn(tn, options, set_power_fn, get_power_fn, retry_attempts =
pass
options["--plug"] = plug
- set_power_fn(tn, options)
+ set_power_fn(connection, options)
time.sleep(int(options["--power-wait"]))
for _ in xrange(int(options["--power-timeout"])):
- if get_multi_power_fn(tn, options, get_power_fn) != options["--action"]:
+ if get_multi_power_fn(connection, options, get_power_fn) != options["--action"]:
time.sleep(1)
else:
return True
@@ -909,7 +912,7 @@ def show_docs(options, docs=None):
print __main__.REDHAT_COPYRIGHT
sys.exit(0)
-def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list=None, reboot_cycle_fn=None):
+def fence_action(connection, options, set_power_fn, get_power_fn, get_outlet_list=None, reboot_cycle_fn=None):
result = 0
try:
@@ -929,7 +932,7 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list=None,
return
elif (options["--action"] == "list") or \
((options["--action"] == "monitor") and 1 == options["device_opt"].count("port")):
- outlets = get_outlet_list(tn, options)
+ outlets = get_outlet_list(connection, options)
## keys can be numbers (port numbers) or strings (names of VM)
for outlet_id in outlets.keys():
(alias, status) = outlets[outlet_id]
@@ -937,7 +940,7 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list=None,
print outlet_id + options["--separator"] + alias
return
- status = get_multi_power_fn(tn, options, get_power_fn)
+ status = get_multi_power_fn(connection, options, get_power_fn)
if status != "on" and status != "off":
fail(EC_STATUS)
@@ -947,12 +950,12 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list=None,
return 0
if options["--action"] == "on":
- if set_multi_power_fn(tn, options, set_power_fn, get_power_fn, 1 + int(options["--retry-on"])):
+ if set_multi_power_fn(connection, options, set_power_fn, get_power_fn, 1 + int(options["--retry-on"])):
print "Success: Powered ON"
else:
fail(EC_WAITING_ON)
elif options["--action"] == "off":
- if set_multi_power_fn(tn, options, set_power_fn, get_power_fn):
+ if set_multi_power_fn(connection, options, set_power_fn, get_power_fn):
print "Success: Powered OFF"
else:
fail(EC_WAITING_OFF)
@@ -960,7 +963,7 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list=None,
power_on = False
if options.get("--method", "").lower() == "cycle" and reboot_cycle_fn is not None:
for _ in range(1, 1 + int(options["--retry-on"])):
- if reboot_cycle_fn(tn, options):
+ if reboot_cycle_fn(connection, options):
power_on = True
break
@@ -970,13 +973,13 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list=None,
else:
if status != "off":
options["--action"] = "off"
- if not set_multi_power_fn(tn, options, set_power_fn, get_power_fn):
+ if not set_multi_power_fn(connection, options, set_power_fn, get_power_fn):
fail(EC_WAITING_OFF)
options["--action"] = "on"
try:
- power_on = set_multi_power_fn(tn, options, set_power_fn, get_power_fn, int(options["--retry-on"]))
+ power_on = set_multi_power_fn(connection, options, set_power_fn, get_power_fn, int(options["--retry-on"]))
except Exception, ex:
# an error occured during power ON phase in reboot
# fence action was completed succesfully even in that case
@@ -1195,8 +1198,8 @@ def fence_logout(conn, logout_string, sleep=0):
# Convert array of format [[key1, value1], [key2, value2], ... [keyN, valueN]] to dict, where key is
# in format a.b.c.d...z and returned dict has key only z
-def array_to_dict(ar):
- return dict([[x[0].split(".")[-1], x[1]] for x in ar])
+def array_to_dict(array):
+ return dict([[x[0].split(".")[-1], x[1]] for x in array])
## Own logger handler that uses old-style syslog handler as otherwise everything is sourced
## from /dev/syslog
@@ -1217,5 +1220,5 @@ class SyslogLibHandler(logging.StreamHandler):
msg = self.format(record)
# syslos.syslog can not have 0x00 character inside or exception is thrown
- syslog.syslog(syslog_level, msg.replace("\x00","\n"))
+ syslog.syslog(syslog_level, msg.replace("\x00", "\n"))
return
9 years, 5 months
fence-agents: master - fence_ilo_ssh: Add XML regression test data
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=9c837a...
Commit: 9c837a80ad8a8ad8cd6e2484507037cf0685fdf7
Parent: 8bd6050dccf93621066c5ae5cb8ae1953c331e63
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Dec 1 20:57:13 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Dec 1 20:57:13 2014 +0100
fence_ilo_ssh: Add XML regression test data
---
tests/data/metadata/fence_ilo3_ssh.xml | 146 ++++++++++++++++++++++++++++++++
tests/data/metadata/fence_ilo4_ssh.xml | 146 ++++++++++++++++++++++++++++++++
tests/data/metadata/fence_ilo_ssh.xml | 146 ++++++++++++++++++++++++++++++++
3 files changed, 438 insertions(+), 0 deletions(-)
diff --git a/tests/data/metadata/fence_ilo3_ssh.xml b/tests/data/metadata/fence_ilo3_ssh.xml
new file mode 100644
index 0000000..d1341dc
--- /dev/null
+++ b/tests/data/metadata/fence_ilo3_ssh.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" ?>
+<resource-agent name="fence_ilo3_ssh" shortdesc="Fence agent for HP iLO over SSH" >
+<symlink name="fence_ilo3_ssh" shortdesc="Fence agent for HP iLO3 over SSH"/>
+<symlink name="fence_ilo4_ssh" shortdesc="Fence agent for HP iLO4 over SSH"/>
+<longdesc>fence_ilo_ssh is a fence agent that connects to iLO device. It logs into device via ssh and reboot a specified outlet. </longdesc>
+<vendor-url>http://www.hp.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="0" required="1">
+ <getopt mixed="-o, --action=[action]" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="cmd_prompt" unique="0" required="0">
+ <getopt mixed="-c, --command-prompt=[prompt]" />
+ <content type="string" default="['MP>', 'hpiLO->']" />
+ <shortdesc lang="en">Force Python regex for command prompt</shortdesc>
+ </parameter>
+ <parameter name="identity_file" unique="0" required="0">
+ <getopt mixed="-k, --identity-file=[filename]" />
+ <content type="string" />
+ <shortdesc lang="en">Identity file for ssh</shortdesc>
+ </parameter>
+ <parameter name="inet4_only" unique="0" required="0">
+ <getopt mixed="-4, --inet4-only" />
+ <content type="boolean" />
+ <shortdesc lang="en">Forces agent to use IPv4 addresses only</shortdesc>
+ </parameter>
+ <parameter name="inet6_only" unique="0" required="0">
+ <getopt mixed="-6, --inet6-only" />
+ <content type="boolean" />
+ <shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="0" required="1">
+ <getopt mixed="-a, --ip=[ip]" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="ipport" unique="0" required="0">
+ <getopt mixed="-u, --ipport=[port]" />
+ <content type="string" default="23" />
+ <shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
+ </parameter>
+ <parameter name="login" unique="0" required="1">
+ <getopt mixed="-l, --username=[name]" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="method" unique="0" required="0">
+ <getopt mixed="-m, --method=[method]" />
+ <content type="select" default="onoff" >
+ <option value="onoff" />
+ <option value="cycle" />
+ </content>
+ <shortdesc lang="en">Method to fence (onoff|cycle)</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="0" required="0">
+ <getopt mixed="-p, --password=[password]" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="0" required="0">
+ <getopt mixed="-S, --password-script=[script]" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="secure" unique="0" required="0">
+ <getopt mixed="-x, --ssh" />
+ <content type="boolean" />
+ <shortdesc lang="en">SSH connection</shortdesc>
+ </parameter>
+ <parameter name="ssh_options" unique="0" required="0">
+ <getopt mixed="--ssh-options=[options]" />
+ <content type="string" />
+ <shortdesc lang="en">SSH options to use</shortdesc>
+ </parameter>
+ <parameter name="verbose" unique="0" required="0">
+ <getopt mixed="-v, --verbose" />
+ <content type="boolean" />
+ <shortdesc lang="en">Verbose mode</shortdesc>
+ </parameter>
+ <parameter name="debug" unique="0" required="0">
+ <getopt mixed="-D, --debug-file=[debugfile]" />
+ <content type="string" />
+ <shortdesc lang="en">Write debug information to given file</shortdesc>
+ </parameter>
+ <parameter name="version" unique="0" required="0">
+ <getopt mixed="-V, --version" />
+ <content type="boolean" />
+ <shortdesc lang="en">Display version information and exit</shortdesc>
+ </parameter>
+ <parameter name="help" unique="0" required="0">
+ <getopt mixed="-h, --help" />
+ <content type="boolean" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="0" required="0">
+ <getopt mixed="--delay=[seconds]" />
+ <content type="string" default="0" />
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="login_timeout" unique="0" required="0">
+ <getopt mixed="--login-timeout=[seconds]" />
+ <content type="string" default="5" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc>
+ </parameter>
+ <parameter name="power_timeout" unique="0" required="0">
+ <getopt mixed="--power-timeout=[seconds]" />
+ <content type="string" default="20" />
+ <shortdesc lang="en">Test X seconds for status change after ON/OFF</shortdesc>
+ </parameter>
+ <parameter name="power_wait" unique="0" required="0">
+ <getopt mixed="--power-wait=[seconds]" />
+ <content type="string" default="5" />
+ <shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
+ </parameter>
+ <parameter name="shell_timeout" unique="0" required="0">
+ <getopt mixed="--shell-timeout=[seconds]" />
+ <content type="string" default="3" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
+ </parameter>
+ <parameter name="retry_on" unique="0" required="0">
+ <getopt mixed="--retry-on=[attempts]" />
+ <content type="string" default="1" />
+ <shortdesc lang="en">Count of attempts to retry power on</shortdesc>
+ </parameter>
+ <parameter name="ssh_path" unique="0" required="0">
+ <getopt mixed="--ssh-path=[path]" />
+ <content type="string" default="/usr/bin/ssh" />
+ <shortdesc lang="en">Path to ssh binary</shortdesc>
+ </parameter>
+ <parameter name="telnet_path" unique="0" required="0">
+ <getopt mixed="--telnet-path=[path]" />
+ <content type="string" default="/usr/bin/telnet" />
+ <shortdesc lang="en">Path to telnet binary</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" automatic="0"/>
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="list" />
+ <action name="monitor" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
diff --git a/tests/data/metadata/fence_ilo4_ssh.xml b/tests/data/metadata/fence_ilo4_ssh.xml
new file mode 100644
index 0000000..26dea3c
--- /dev/null
+++ b/tests/data/metadata/fence_ilo4_ssh.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" ?>
+<resource-agent name="fence_ilo4_ssh" shortdesc="Fence agent for HP iLO over SSH" >
+<symlink name="fence_ilo3_ssh" shortdesc="Fence agent for HP iLO3 over SSH"/>
+<symlink name="fence_ilo4_ssh" shortdesc="Fence agent for HP iLO4 over SSH"/>
+<longdesc>fence_ilo_ssh is a fence agent that connects to iLO device. It logs into device via ssh and reboot a specified outlet. </longdesc>
+<vendor-url>http://www.hp.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="0" required="1">
+ <getopt mixed="-o, --action=[action]" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="cmd_prompt" unique="0" required="0">
+ <getopt mixed="-c, --command-prompt=[prompt]" />
+ <content type="string" default="['MP>', 'hpiLO->']" />
+ <shortdesc lang="en">Force Python regex for command prompt</shortdesc>
+ </parameter>
+ <parameter name="identity_file" unique="0" required="0">
+ <getopt mixed="-k, --identity-file=[filename]" />
+ <content type="string" />
+ <shortdesc lang="en">Identity file for ssh</shortdesc>
+ </parameter>
+ <parameter name="inet4_only" unique="0" required="0">
+ <getopt mixed="-4, --inet4-only" />
+ <content type="boolean" />
+ <shortdesc lang="en">Forces agent to use IPv4 addresses only</shortdesc>
+ </parameter>
+ <parameter name="inet6_only" unique="0" required="0">
+ <getopt mixed="-6, --inet6-only" />
+ <content type="boolean" />
+ <shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="0" required="1">
+ <getopt mixed="-a, --ip=[ip]" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="ipport" unique="0" required="0">
+ <getopt mixed="-u, --ipport=[port]" />
+ <content type="string" default="23" />
+ <shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
+ </parameter>
+ <parameter name="login" unique="0" required="1">
+ <getopt mixed="-l, --username=[name]" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="method" unique="0" required="0">
+ <getopt mixed="-m, --method=[method]" />
+ <content type="select" default="onoff" >
+ <option value="onoff" />
+ <option value="cycle" />
+ </content>
+ <shortdesc lang="en">Method to fence (onoff|cycle)</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="0" required="0">
+ <getopt mixed="-p, --password=[password]" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="0" required="0">
+ <getopt mixed="-S, --password-script=[script]" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="secure" unique="0" required="0">
+ <getopt mixed="-x, --ssh" />
+ <content type="boolean" />
+ <shortdesc lang="en">SSH connection</shortdesc>
+ </parameter>
+ <parameter name="ssh_options" unique="0" required="0">
+ <getopt mixed="--ssh-options=[options]" />
+ <content type="string" />
+ <shortdesc lang="en">SSH options to use</shortdesc>
+ </parameter>
+ <parameter name="verbose" unique="0" required="0">
+ <getopt mixed="-v, --verbose" />
+ <content type="boolean" />
+ <shortdesc lang="en">Verbose mode</shortdesc>
+ </parameter>
+ <parameter name="debug" unique="0" required="0">
+ <getopt mixed="-D, --debug-file=[debugfile]" />
+ <content type="string" />
+ <shortdesc lang="en">Write debug information to given file</shortdesc>
+ </parameter>
+ <parameter name="version" unique="0" required="0">
+ <getopt mixed="-V, --version" />
+ <content type="boolean" />
+ <shortdesc lang="en">Display version information and exit</shortdesc>
+ </parameter>
+ <parameter name="help" unique="0" required="0">
+ <getopt mixed="-h, --help" />
+ <content type="boolean" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="0" required="0">
+ <getopt mixed="--delay=[seconds]" />
+ <content type="string" default="0" />
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="login_timeout" unique="0" required="0">
+ <getopt mixed="--login-timeout=[seconds]" />
+ <content type="string" default="5" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc>
+ </parameter>
+ <parameter name="power_timeout" unique="0" required="0">
+ <getopt mixed="--power-timeout=[seconds]" />
+ <content type="string" default="20" />
+ <shortdesc lang="en">Test X seconds for status change after ON/OFF</shortdesc>
+ </parameter>
+ <parameter name="power_wait" unique="0" required="0">
+ <getopt mixed="--power-wait=[seconds]" />
+ <content type="string" default="5" />
+ <shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
+ </parameter>
+ <parameter name="shell_timeout" unique="0" required="0">
+ <getopt mixed="--shell-timeout=[seconds]" />
+ <content type="string" default="3" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
+ </parameter>
+ <parameter name="retry_on" unique="0" required="0">
+ <getopt mixed="--retry-on=[attempts]" />
+ <content type="string" default="1" />
+ <shortdesc lang="en">Count of attempts to retry power on</shortdesc>
+ </parameter>
+ <parameter name="ssh_path" unique="0" required="0">
+ <getopt mixed="--ssh-path=[path]" />
+ <content type="string" default="/usr/bin/ssh" />
+ <shortdesc lang="en">Path to ssh binary</shortdesc>
+ </parameter>
+ <parameter name="telnet_path" unique="0" required="0">
+ <getopt mixed="--telnet-path=[path]" />
+ <content type="string" default="/usr/bin/telnet" />
+ <shortdesc lang="en">Path to telnet binary</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" automatic="0"/>
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="list" />
+ <action name="monitor" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
diff --git a/tests/data/metadata/fence_ilo_ssh.xml b/tests/data/metadata/fence_ilo_ssh.xml
new file mode 100644
index 0000000..23be991
--- /dev/null
+++ b/tests/data/metadata/fence_ilo_ssh.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" ?>
+<resource-agent name="fence_ilo_ssh" shortdesc="Fence agent for HP iLO over SSH" >
+<symlink name="fence_ilo3_ssh" shortdesc="Fence agent for HP iLO3 over SSH"/>
+<symlink name="fence_ilo4_ssh" shortdesc="Fence agent for HP iLO4 over SSH"/>
+<longdesc>fence_ilo_ssh is a fence agent that connects to iLO device. It logs into device via ssh and reboot a specified outlet. </longdesc>
+<vendor-url>http://www.hp.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="0" required="1">
+ <getopt mixed="-o, --action=[action]" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="cmd_prompt" unique="0" required="0">
+ <getopt mixed="-c, --command-prompt=[prompt]" />
+ <content type="string" default="['MP>', 'hpiLO->']" />
+ <shortdesc lang="en">Force Python regex for command prompt</shortdesc>
+ </parameter>
+ <parameter name="identity_file" unique="0" required="0">
+ <getopt mixed="-k, --identity-file=[filename]" />
+ <content type="string" />
+ <shortdesc lang="en">Identity file for ssh</shortdesc>
+ </parameter>
+ <parameter name="inet4_only" unique="0" required="0">
+ <getopt mixed="-4, --inet4-only" />
+ <content type="boolean" />
+ <shortdesc lang="en">Forces agent to use IPv4 addresses only</shortdesc>
+ </parameter>
+ <parameter name="inet6_only" unique="0" required="0">
+ <getopt mixed="-6, --inet6-only" />
+ <content type="boolean" />
+ <shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="0" required="1">
+ <getopt mixed="-a, --ip=[ip]" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="ipport" unique="0" required="0">
+ <getopt mixed="-u, --ipport=[port]" />
+ <content type="string" default="23" />
+ <shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
+ </parameter>
+ <parameter name="login" unique="0" required="1">
+ <getopt mixed="-l, --username=[name]" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="method" unique="0" required="0">
+ <getopt mixed="-m, --method=[method]" />
+ <content type="select" default="onoff" >
+ <option value="onoff" />
+ <option value="cycle" />
+ </content>
+ <shortdesc lang="en">Method to fence (onoff|cycle)</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="0" required="0">
+ <getopt mixed="-p, --password=[password]" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="0" required="0">
+ <getopt mixed="-S, --password-script=[script]" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="secure" unique="0" required="0">
+ <getopt mixed="-x, --ssh" />
+ <content type="boolean" />
+ <shortdesc lang="en">SSH connection</shortdesc>
+ </parameter>
+ <parameter name="ssh_options" unique="0" required="0">
+ <getopt mixed="--ssh-options=[options]" />
+ <content type="string" />
+ <shortdesc lang="en">SSH options to use</shortdesc>
+ </parameter>
+ <parameter name="verbose" unique="0" required="0">
+ <getopt mixed="-v, --verbose" />
+ <content type="boolean" />
+ <shortdesc lang="en">Verbose mode</shortdesc>
+ </parameter>
+ <parameter name="debug" unique="0" required="0">
+ <getopt mixed="-D, --debug-file=[debugfile]" />
+ <content type="string" />
+ <shortdesc lang="en">Write debug information to given file</shortdesc>
+ </parameter>
+ <parameter name="version" unique="0" required="0">
+ <getopt mixed="-V, --version" />
+ <content type="boolean" />
+ <shortdesc lang="en">Display version information and exit</shortdesc>
+ </parameter>
+ <parameter name="help" unique="0" required="0">
+ <getopt mixed="-h, --help" />
+ <content type="boolean" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="0" required="0">
+ <getopt mixed="--delay=[seconds]" />
+ <content type="string" default="0" />
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="login_timeout" unique="0" required="0">
+ <getopt mixed="--login-timeout=[seconds]" />
+ <content type="string" default="5" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc>
+ </parameter>
+ <parameter name="power_timeout" unique="0" required="0">
+ <getopt mixed="--power-timeout=[seconds]" />
+ <content type="string" default="20" />
+ <shortdesc lang="en">Test X seconds for status change after ON/OFF</shortdesc>
+ </parameter>
+ <parameter name="power_wait" unique="0" required="0">
+ <getopt mixed="--power-wait=[seconds]" />
+ <content type="string" default="5" />
+ <shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
+ </parameter>
+ <parameter name="shell_timeout" unique="0" required="0">
+ <getopt mixed="--shell-timeout=[seconds]" />
+ <content type="string" default="3" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
+ </parameter>
+ <parameter name="retry_on" unique="0" required="0">
+ <getopt mixed="--retry-on=[attempts]" />
+ <content type="string" default="1" />
+ <shortdesc lang="en">Count of attempts to retry power on</shortdesc>
+ </parameter>
+ <parameter name="ssh_path" unique="0" required="0">
+ <getopt mixed="--ssh-path=[path]" />
+ <content type="string" default="/usr/bin/ssh" />
+ <shortdesc lang="en">Path to ssh binary</shortdesc>
+ </parameter>
+ <parameter name="telnet_path" unique="0" required="0">
+ <getopt mixed="--telnet-path=[path]" />
+ <content type="string" default="/usr/bin/telnet" />
+ <shortdesc lang="en">Path to telnet binary</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" automatic="0"/>
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="list" />
+ <action name="monitor" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
9 years, 5 months
fence-agents: v4.0.13 annotated tag has been created
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=16686f...
Commit: 16686f337d3ea85cc4b02c469f96a57bd04ac019
Parent: 0000000000000000000000000000000000000000
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: 2014-12-01 19:58 +0000
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: 2014-12-01 19:58 +0000
annotated tag: v4.0.13 has been created
at 16686f337d3ea85cc4b02c469f96a57bd04ac019 (tag)
tagging 9c837a80ad8a8ad8cd6e2484507037cf0685fdf7 (commit)
replaces v4.0.12
v4.0.13 release
Marek 'marx' Grac (21):
[build]: Add build requirements to autoconf
fence_zvm: Add support for 'monitor'
fencing: Available actions in --help where not always up-to-date
fencing: Stability of sort of items in XML metadata
fence_scsi: Short getopt for logfile differs in help/getopt
fencing: Some short options were not propagated, so they were removed
fencing: Improve accessibility of possible connection (+telnet,+web)
fencing: Introduce --gnutlscli-path --sudo-path --ssh-path and --telnet-path
fence_scsi: "order" value of *_path should be same as in library
fence_mpath: new fence agent for dm-multipath based on mpathpersist
fencing: Fix problem with not validating SSL certificates
fence_cisco_ucs: protocol prefix of URL was not correctly set with --ssl-(in)secure
fence_bladecenter: Simplify login process
[fencing] Character
9 years, 5 months
fence-agents: master - fence_mpath: Do not run regression test on store_path value
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=8bd605...
Commit: 8bd6050dccf93621066c5ae5cb8ae1953c331e63
Parent: df5bcaaddc8fcb3481c0d9389417f069dc7c7674
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Dec 1 20:39:47 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Dec 1 20:39:47 2014 +0100
fence_mpath: Do not run regression test on store_path value
This is not possible because unlike the other paths this one
is dependant on ./configure --prefix XXX. With this patch,
line with value will be removed.
---
make/agentpycheck.mk | 5 ++-
tests/data/metadata/fence_mpath.xml | 46 +++++++++++++++++++----------------
2 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/make/agentpycheck.mk b/make/agentpycheck.mk
index 63cb9da..090116b 100644
--- a/make/agentpycheck.mk
+++ b/make/agentpycheck.mk
@@ -1,18 +1,19 @@
TEMPFILE:=$(shell mktemp)
#DATADIR:=$(abs_top_builddir)/tests/data/metadata
DATADIR:=$(abs_top_srcdir)/tests/data/metadata
+AWK='BEGIN {store=-1} /name=\"store_path\"/ {store=2} {if (store!=0) {print}; store--}'
check: $(TARGET:%=xml-check.%) $(SYMTARGET:%=xml-check.%) $(TARGET:%=delay-check.%)
xml-check.%: %
$(eval INPUT=$(subst xml-check.,,$@))
- PYTHONPATH=$(abs_srcdir)/../lib:$(abs_builddir)/../lib python ./$(INPUT) -o metadata > $(TEMPFILE)
+ PYTHONPATH=$(abs_srcdir)/../lib:$(abs_builddir)/../lib python ./$(INPUT) -o metadata | awk $(AWK) > $(TEMPFILE)
diff $(TEMPFILE) $(DATADIR)/$(INPUT).xml
rm $(TEMPFILE)
xml-upload.%: %
$(eval INPUT=$(subst xml-upload.,,$@))
- PYTHONPATH=$(abs_srcdir)/../lib:$(abs_builddir)/../lib python ./$(INPUT) -o metadata > $(DATADIR)/$(INPUT).xml
+ PYTHONPATH=$(abs_srcdir)/../lib:$(abs_builddir)/../lib python ./$(INPUT) -o metadata | awk $(AWK) > $(DATADIR)/$(INPUT).xml
# If test will fail, rerun fence agents to show problems
delay-check.%: %
diff --git a/tests/data/metadata/fence_mpath.xml b/tests/data/metadata/fence_mpath.xml
index c62dd49..d76c66d 100644
--- a/tests/data/metadata/fence_mpath.xml
+++ b/tests/data/metadata/fence_mpath.xml
@@ -4,6 +4,11 @@
The fence_mpath agent works by having an unique key for each pair of node and device that has to be set also in /etc/multipath.conf. Once registered, a single node will become the reservation holder by creating a "write exclusive, registrants only" reservation on the device(s). The result is that only registered nodes may write to the device(s). When a node failure occurs, the fence_mpath agent will remove the key belonging to the failed node from the device(s). The failed node will no longer be able to write to the device(s). A manual reboot is required.</longdesc>
<vendor-url>https://www.sourceware.org/dm/</vendor-url>
<parameters>
+ <parameter name="action" unique="0" required="1">
+ <getopt mixed="-o, --action=[action]" />
+ <content type="string" default="off" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
<parameter name="devices" unique="0" required="0">
<getopt mixed="-d, --devices=[devices]" />
<content type="string" />
@@ -14,11 +19,6 @@ The fence_mpath agent works by having an unique key for each pair of node and de
<content type="string" />
<shortdesc lang="en">Key to use for the current operation. This key should be unique to a node and have to be written in /etc/multipath.conf. For the "on" action, the key specifies the key use to register the local node. For the "off" action, this key specifies the key to be removed from the device(s).</shortdesc>
</parameter>
- <parameter name="action" unique="0" required="1">
- <getopt mixed="-o, --action=[action]" />
- <content type="string" default="off" />
- <shortdesc lang="en">Fencing Action</shortdesc>
- </parameter>
<parameter name="verbose" unique="0" required="0">
<getopt mixed="-v, --verbose" />
<content type="boolean" />
@@ -44,15 +44,15 @@ The fence_mpath agent works by having an unique key for each pair of node and de
<content type="string" default="0" />
<shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
</parameter>
- <parameter name="shell_timeout" unique="0" required="0">
- <getopt mixed="--shell-timeout=[seconds]" />
- <content type="string" default="3" />
- <shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
+ <parameter name="login_timeout" unique="0" required="0">
+ <getopt mixed="--login-timeout=[seconds]" />
+ <content type="string" default="5" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc>
</parameter>
- <parameter name="store_path" unique="0" required="0">
- <getopt mixed="--store-path=[path]" />
- <content type="string" default="/var/run/cluster" />
- <shortdesc lang="en">Path to directory where fence agent can store information</shortdesc>
+ <parameter name="mpathpersist_path" unique="0" required="0">
+ <getopt mixed="--mpathpersist-path=[path]" />
+ <content type="string" default="/usr/sbin/mpathpersist" />
+ <shortdesc lang="en">Path to mpathpersist binary</shortdesc>
</parameter>
<parameter name="power_timeout" unique="0" required="0">
<getopt mixed="--power-timeout=[seconds]" />
@@ -64,15 +64,14 @@ The fence_mpath agent works by having an unique key for each pair of node and de
<content type="string" default="0" />
<shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
</parameter>
- <parameter name="login_timeout" unique="0" required="0">
- <getopt mixed="--login-timeout=[seconds]" />
- <content type="string" default="5" />
- <shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc>
+ <parameter name="shell_timeout" unique="0" required="0">
+ <getopt mixed="--shell-timeout=[seconds]" />
+ <content type="string" default="3" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
</parameter>
- <parameter name="mpathpersist_path" unique="0" required="0">
- <getopt mixed="--mpathpersist-path=[path]" />
- <content type="string" default="/usr/sbin/mpathpersist" />
- <shortdesc lang="en">Path to mpathpersist binary</shortdesc>
+ <parameter name="store_path" unique="0" required="0">
+ <getopt mixed="--store-path=[path]" />
+ <shortdesc lang="en">Path to directory where fence agent can store information</shortdesc>
</parameter>
<parameter name="retry_on" unique="0" required="0">
<getopt mixed="--retry-on=[attempts]" />
@@ -84,6 +83,11 @@ The fence_mpath agent works by having an unique key for each pair of node and de
<content type="boolean" />
<shortdesc lang="en">Use sudo (without password) when calling 3rd party sotfware.</shortdesc>
</parameter>
+ <parameter name="sudo_path" unique="0" required="0">
+ <getopt mixed="--sudo-path=[path]" />
+ <content type="string" default="/usr/bin/sudo" />
+ <shortdesc lang="en">Path to sudo binary</shortdesc>
+ </parameter>
</parameters>
<actions>
<action name="on" on_target="1" automatic="1"/>
9 years, 5 months
fence-agents: master - fence_mpath: Update XML metadata
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=df5bca...
Commit: df5bcaaddc8fcb3481c0d9389417f069dc7c7674
Parent: 9af1fa8c5a04fa2bee34a27e15b02e249c67b0c2
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Dec 1 11:18:59 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Dec 1 11:18:59 2014 +0100
fence_mpath: Update XML metadata
---
tests/data/metadata/fence_mpath.xml | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/tests/data/metadata/fence_mpath.xml b/tests/data/metadata/fence_mpath.xml
index bd8b141..c62dd49 100644
--- a/tests/data/metadata/fence_mpath.xml
+++ b/tests/data/metadata/fence_mpath.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" ?>
<resource-agent name="fence_mpath" shortdesc="Fence agent for multipath persistent reservation" >
-<longdesc>...</longdesc>
-<vendor-url>fence_mpath is an I/O fencing agent that uses SCSI-3 persistent reservations to control access to shared storage devices. These devices must be controlled by dm-multipath and underlying devices must support SCSI-3 persistent reservations (SPC-3 or greater) as well as the "preempt-and-abort" subcommand.
- The fence_mpath agent works by having unique key for each pair: node and device. These keys have to be manually added to /etc/multipath.conf. Once registered, a single node will become the reservation holder by creating a "write exclusive, registrants only" reservation on the device(s). The result is that only registered nodes may write to the device(s). When a node failure occurs, the fence_scsi agent will remove the key belonging to the failed node from the device(s). The failed node will no longer be able to write to the device(s). A manual reboot is required.</vendor-url>
+<longdesc>fence_mpath is an I/O fencing agent that uses SCSI-3 persistent reservations to control access multipath devices. Underlying devices must support SCSI-3 persistent reservations (SPC-3 or greater) as well as the "preempt-and-abort" subcommand.
+The fence_mpath agent works by having an unique key for each pair of node and device that has to be set also in /etc/multipath.conf. Once registered, a single node will become the reservation holder by creating a "write exclusive, registrants only" reservation on the device(s). The result is that only registered nodes may write to the device(s). When a node failure occurs, the fence_mpath agent will remove the key belonging to the failed node from the device(s). The failed node will no longer be able to write to the device(s). A manual reboot is required.</longdesc>
+<vendor-url>https://www.sourceware.org/dm/</vendor-url>
<parameters>
<parameter name="devices" unique="0" required="0">
<getopt mixed="-d, --devices=[devices]" />
@@ -39,11 +39,21 @@
<content type="boolean" />
<shortdesc lang="en">Display help and exit</shortdesc>
</parameter>
+ <parameter name="delay" unique="0" required="0">
+ <getopt mixed="--delay=[seconds]" />
+ <content type="string" default="0" />
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
<parameter name="shell_timeout" unique="0" required="0">
<getopt mixed="--shell-timeout=[seconds]" />
<content type="string" default="3" />
<shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
</parameter>
+ <parameter name="store_path" unique="0" required="0">
+ <getopt mixed="--store-path=[path]" />
+ <content type="string" default="/var/run/cluster" />
+ <shortdesc lang="en">Path to directory where fence agent can store information</shortdesc>
+ </parameter>
<parameter name="power_timeout" unique="0" required="0">
<getopt mixed="--power-timeout=[seconds]" />
<content type="string" default="20" />
@@ -54,11 +64,6 @@
<content type="string" default="0" />
<shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
</parameter>
- <parameter name="delay" unique="0" required="0">
- <getopt mixed="--delay=[seconds]" />
- <content type="string" default="0" />
- <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
- </parameter>
<parameter name="login_timeout" unique="0" required="0">
<getopt mixed="--login-timeout=[seconds]" />
<content type="string" default="5" />
@@ -67,13 +72,18 @@
<parameter name="mpathpersist_path" unique="0" required="0">
<getopt mixed="--mpathpersist-path=[path]" />
<content type="string" default="/usr/sbin/mpathpersist" />
- <shortdesc lang="en">Path to sg_persist binary</shortdesc>
+ <shortdesc lang="en">Path to mpathpersist binary</shortdesc>
</parameter>
<parameter name="retry_on" unique="0" required="0">
<getopt mixed="--retry-on=[attempts]" />
<content type="string" default="1" />
<shortdesc lang="en">Count of attempts to retry power on</shortdesc>
</parameter>
+ <parameter name="sudo" unique="0" required="0">
+ <getopt mixed="--use-sudo" />
+ <content type="boolean" />
+ <shortdesc lang="en">Use sudo (without password) when calling 3rd party sotfware.</shortdesc>
+ </parameter>
</parameters>
<actions>
<action name="on" on_target="1" automatic="1"/>
9 years, 5 months
fence-agents: master - fence_scsi: Update XML metadata
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=9af1fa...
Commit: 9af1fa8c5a04fa2bee34a27e15b02e249c67b0c2
Parent: cf83b8aebf21dc9a306d42aff33d86bd5c20bcbc
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Dec 1 11:14:00 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Dec 1 11:14:00 2014 +0100
fence_scsi: Update XML metadata
---
tests/data/metadata/fence_scsi.xml | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/tests/data/metadata/fence_scsi.xml b/tests/data/metadata/fence_scsi.xml
index 738dd00..923ae7e 100644
--- a/tests/data/metadata/fence_scsi.xml
+++ b/tests/data/metadata/fence_scsi.xml
@@ -54,11 +54,6 @@ The fence_scsi agent works by having each node in the cluster register a unique
<content type="boolean" />
<shortdesc lang="en">Display help and exit</shortdesc>
</parameter>
- <parameter name="corosync-cmap_path" unique="0" required="0">
- <getopt mixed="--corosync-cmap-path=[path]" />
- <content type="string" default="/usr/sbin/corosync-cmapctl" />
- <shortdesc lang="en">Path to corosync-cmapctl binary</shortdesc>
- </parameter>
<parameter name="delay" unique="0" required="0">
<getopt mixed="--delay=[seconds]" />
<content type="string" default="0" />
@@ -79,6 +74,21 @@ The fence_scsi agent works by having each node in the cluster register a unique
<content type="string" default="0" />
<shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
</parameter>
+ <parameter name="shell_timeout" unique="0" required="0">
+ <getopt mixed="--shell-timeout=[seconds]" />
+ <content type="string" default="3" />
+ <shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
+ </parameter>
+ <parameter name="retry_on" unique="0" required="0">
+ <getopt mixed="--retry-on=[attempts]" />
+ <content type="string" default="1" />
+ <shortdesc lang="en">Count of attempts to retry power on</shortdesc>
+ </parameter>
+ <parameter name="corosync-cmap_path" unique="0" required="0">
+ <getopt mixed="--corosync-cmap-path=[path]" />
+ <content type="string" default="/usr/sbin/corosync-cmapctl" />
+ <shortdesc lang="en">Path to corosync-cmapctl binary</shortdesc>
+ </parameter>
<parameter name="sg_persist_path" unique="0" required="0">
<getopt mixed="--sg_persist-path=[path]" />
<content type="string" default="/usr/bin/sg_persist" />
@@ -89,21 +99,11 @@ The fence_scsi agent works by having each node in the cluster register a unique
<content type="string" default="/usr/bin/sg_turs" />
<shortdesc lang="en">Path to sg_turs binary</shortdesc>
</parameter>
- <parameter name="shell_timeout" unique="0" required="0">
- <getopt mixed="--shell-timeout=[seconds]" />
- <content type="string" default="3" />
- <shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
- </parameter>
<parameter name="vgs_path" unique="0" required="0">
<getopt mixed="--vgs-path=[path]" />
<content type="string" default="/usr/sbin/vgs" />
<shortdesc lang="en">Path to vgs binary</shortdesc>
</parameter>
- <parameter name="retry_on" unique="0" required="0">
- <getopt mixed="--retry-on=[attempts]" />
- <content type="string" default="1" />
- <shortdesc lang="en">Count of attempts to retry power on</shortdesc>
- </parameter>
</parameters>
<actions>
<action name="on" on_target="1" automatic="1"/>
9 years, 5 months
fence-agents: master - fence_ilo_ssh: Create symlinks for fence_ilo3_ssh and fence_ilo4_ssh
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=cf83b8...
Commit: cf83b8aebf21dc9a306d42aff33d86bd5c20bcbc
Parent: 46bd07975854e3ad0b351af93d0cfc769811a81e
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Dec 1 11:04:25 2014 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Dec 1 11:04:25 2014 +0100
fence_ilo_ssh: Create symlinks for fence_ilo3_ssh and fence_ilo4_ssh
Resolves: rhbz#1121122
---
fence/agents/ilo_ssh/Makefile.am | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fence/agents/ilo_ssh/Makefile.am b/fence/agents/ilo_ssh/Makefile.am
index 34769d9..883c306 100644
--- a/fence/agents/ilo_ssh/Makefile.am
+++ b/fence/agents/ilo_ssh/Makefile.am
@@ -8,12 +8,15 @@ SRC = $(TARGET).py
EXTRA_DIST = $(SRC)
-sbin_SCRIPTS = $(TARGET)
+sbin_SCRIPTS = $(TARGET) $(SYMTARGET)
man_MANS = $(TARGET).8 $(SYMTARGET:%=%.8)
FENCE_TEST_ARGS = -p test -a test -l test
+$(SYMTARGET) : $(TARGET)
+ cp $^ $@
+
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fenceman.mk
include $(top_srcdir)/make/agentpycheck.mk
9 years, 5 months