fence-agents: master - fence_amt: sending password over env
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=92928f...
Commit: 92928f5fd7f90805df98d46311a6e99e17ae0fd9
Parent: 95c1e64c75c9ae0410febd9653d6e65b88ff0d88
Author: Ondrej Mular <omular(a)redhat.com>
AuthorDate: Fri Apr 11 07:41:45 2014 -0400
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Apr 14 13:55:03 2014 +0200
fence_amt: sending password over env
---
fence/agents/amt/fence_amt.py | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/fence/agents/amt/fence_amt.py b/fence/agents/amt/fence_amt.py
index dc2fd12..edab61a 100644
--- a/fence/agents/amt/fence_amt.py
+++ b/fence/agents/amt/fence_amt.py
@@ -1,6 +1,6 @@
#!/usr/bin/python -tt
-import sys, re
+import sys, re, os
import atexit
from pipes import quote
sys.path.append("@FENCEAGENTSLIBDIR@")
@@ -14,7 +14,7 @@ BUILD_DATE=""
#END_VERSION_GENERATION
def get_power_status(_, options):
- output = run_command(options, create_command(options, "status"))
+ output = amt_run_command(options, create_command(options, "status"))
match = re.search('Powerstate:[\\s]*(..)', str(output))
status = match.group(1) if match else None
@@ -26,18 +26,20 @@ def get_power_status(_, options):
return "off"
def set_power_status(_, options):
- run_command(options, create_command(options, options["--action"]))
+ amt_run_command(options, create_command(options, options["--action"]))
return
def reboot_cycle(_, options):
(status, _, _) = run_command(options, create_command(options, "cycle"))
return not bool(status)
-def create_command(options, action):
- # --password / -p
- cmd = "AMT_PASSWORD=" + quote(options["--password"])
+def amt_run_command(options, command, timeout = None):
+ env = os.environ.copy()
+ env["AMT_PASSWORD"] = quote(options["--password"])
+ return run_command(options, command, timeout, env)
- cmd += " " + options["--amttool-path"]
+def create_command(options, action):
+ cmd = options["--amttool-path"]
# --ip / -a
cmd += " " + options["--ip"]
10 years
fence-agents: master - fencing: added timeout and env parameters to run_command function
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=95c1e6...
Commit: 95c1e64c75c9ae0410febd9653d6e65b88ff0d88
Parent: 665b26cd5c98877a85d69bc00fa6860b511b6f14
Author: Ondrej Mular <omular(a)redhat.com>
AuthorDate: Fri Apr 11 07:41:38 2014 -0400
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Apr 14 13:54:59 2014 +0200
fencing: added timeout and env parameters to run_command function
Now, we can set enviromant variables and maximum execution time for subprocess.
---
fence/agents/lib/fencing.py.py | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 32040db..31155ac 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -4,6 +4,7 @@ import sys, getopt, time, os, uuid, pycurl, stat
import pexpect, re, atexit, syslog
import logging
import subprocess
+import threading
import shlex
import __main__
@@ -1094,20 +1095,32 @@ def is_executable(path):
return True
return False
-def run_command(options, command):
- # @todo: Use timeouts from options[]
+def run_command(options, command, timeout = None, env = None):
+ if timeout is None and "--power-timeout" in options:
+ timeout = options["--power-timeout"]
+ if timeout is not None:
+ timeout = float(timeout)
+
logging.info("Executing: %s\n" % command)
try:
- process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
except OSError, ex:
fail_usage("Unable to run %s\n" % command)
+ thread = threading.Thread(target = process.wait)
+ thread.start()
+ thread.join(timeout)
+ if (thread.is_alive()):
+ process.kill()
+ fail(EC_TIMED_OUT)
+
status = process.wait()
+
(pipe_stdout, pipe_stderr) = process.communicate()
process.stdout.close()
process.stderr.close()
- logging.debug("%s %s %s\n" % str(status), str(pipe_stdout), str(pipe_stderr))
+ logging.debug("%s %s %s\n" % (str(status), str(pipe_stdout), str(pipe_stderr)))
return (status, pipe_stdout, pipe_stderr)
10 years
fence-agents: master - [cleanup] Cleaning in fence_raritan
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=665b26...
Commit: 665b26cd5c98877a85d69bc00fa6860b511b6f14
Parent: 4faf748e7fe50c2665f546df479514d98872f2fa
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Apr 11 10:48:43 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Apr 11 10:48:43 2014 +0200
[cleanup] Cleaning in fence_raritan
Previous set of patches was prepared without this new fence agent.
---
fence/agents/raritan/fence_raritan.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fence/agents/raritan/fence_raritan.py b/fence/agents/raritan/fence_raritan.py
index 01059ce..3318fbf 100644
--- a/fence/agents/raritan/fence_raritan.py
+++ b/fence/agents/raritan/fence_raritan.py
@@ -1,6 +1,6 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
-import sys, re, pexpect, exceptions
+import sys, re, pexpect
import atexit
import time
sys.path.append("@FENCEAGENTSLIBDIR@")
@@ -60,7 +60,7 @@ block any necessary fencing actions."
# add support also for delay before login which is very useful for 2-node clusters
if options["--action"] in ["off", "reboot"]:
- time.sleep(int(options["--delay"]))
+ time.sleep(int(options["--delay"]))
##
## Operate the fencing device
@@ -70,7 +70,7 @@ block any necessary fencing actions."
conn = fspawn(options, TELNET_PATH)
conn.send("set binary\n")
conn.send("open %s -%s\n"%(options["--ip"], options["--ipport"]))
- screen = conn.read_nonblocking(size=100, timeout=int(options["--shell-timeout"]))
+ conn.read_nonblocking(size=100, timeout=int(options["--shell-timeout"]))
conn.log_expect(options, "Login.*", int(options["--shell-timeout"]))
conn.send_eol("%s" % (options["--username"]))
conn.log_expect(options, "Password.*", int(options["--shell-timeout"]))
10 years
fence-agents: master - fence_vmware: Invalid arguments for vmware_get_outlets_vi()
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=4faf74...
Commit: 4faf748e7fe50c2665f546df479514d98872f2fa
Parent: 471c42106a8d2fbf168bd08e97cf46766ab06bc3
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Apr 10 22:37:46 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Apr 11 09:38:36 2014 +0200
fence_vmware: Invalid arguments for vmware_get_outlets_vi()
Fence agent was not working correctly for VMWare ESX because function vmware_get_outlets_vi()
was called with additional arguments.
---
fence/agents/vmware/fence_vmware.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py
index b5cca48..80dc122 100644
--- a/fence/agents/vmware/fence_vmware.py
+++ b/fence/agents/vmware/fence_vmware.py
@@ -223,7 +223,7 @@ def get_outlets_status(conn, options):
def get_power_status(conn, options):
if (vmware_internal_type==VMWARE_TYPE_ESX):
- outlets = vmware_get_outlets_vi(conn, options, True)
+ outlets = vmware_get_outlets_vi(options, True)
else:
outlets = get_outlets_status(conn, options)
10 years
fence-agents: master - [cleanup] Define parent class even if it is object
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=471c42...
Commit: 471c42106a8d2fbf168bd08e97cf46766ab06bc3
Parent: f136b9d40d79ffa57f384c8b896f71466ab7b554
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Apr 9 23:28:46 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Apr 11 09:38:30 2014 +0200
[cleanup] Define parent class even if it is object
Resolve warning: old-style-class
---
fence/agents/apc_snmp/fence_apc_snmp.py | 8 ++++----
fence/agents/eaton_snmp/fence_eaton_snmp.py | 4 ++--
fence/agents/ipdu/fence_ipdu.py | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/fence/agents/apc_snmp/fence_apc_snmp.py b/fence/agents/apc_snmp/fence_apc_snmp.py
index 1810247..0a0d409 100644
--- a/fence/agents/apc_snmp/fence_apc_snmp.py
+++ b/fence/agents/apc_snmp/fence_apc_snmp.py
@@ -39,7 +39,7 @@ port_id = None
switch_id = None
# Classes describing Device params
-class TripplitePDU:
+class TripplitePDU(object):
# Rack PDU
status_oid = '.1.3.6.1.4.1.850.10.2.3.5.1.2.1.%d'
control_oid = '.1.3.6.1.4.1.850.10.2.3.5.1.4.1.%d'
@@ -51,7 +51,7 @@ class TripplitePDU:
turn_off = 1
has_switches = False
-class ApcRPDU:
+class ApcRPDU(object):
# Rack PDU
status_oid = '.1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.%d'
control_oid = '.1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.%d'
@@ -63,7 +63,7 @@ class ApcRPDU:
turn_off = 2
has_switches = False
-class ApcMSP:
+class ApcMSP(object):
# Master Switch+
status_oid = '.1.3.6.1.4.1.318.1.1.6.7.1.1.5.%d.1.%d'
control_oid = '.1.3.6.1.4.1.318.1.1.6.5.1.1.5.%d.1.%d'
@@ -75,7 +75,7 @@ class ApcMSP:
turn_off = 3
has_switches = True
-class ApcMS:
+class ApcMS(object):
# Master Switch - seems oldest, but supported on every APC PDU
status_oid = '.1.3.6.1.4.1.318.1.1.4.4.2.1.3.%d'
control_oid = '.1.3.6.1.4.1.318.1.1.4.4.2.1.3.%d'
diff --git a/fence/agents/eaton_snmp/fence_eaton_snmp.py b/fence/agents/eaton_snmp/fence_eaton_snmp.py
index b14eef4..24dfd9e 100644
--- a/fence/agents/eaton_snmp/fence_eaton_snmp.py
+++ b/fence/agents/eaton_snmp/fence_eaton_snmp.py
@@ -37,7 +37,7 @@ after_set = False
# Classes describing Device params
# Managed ePDU
-class EatonManagedePDU:
+class EatonManagedePDU(object):
status_oid = '.1.3.6.1.4.1.534.6.6.6.1.2.2.1.3.%d'
control_oid = '.1.3.6.1.4.1.534.6.6.6.1.2.2.1.3.%d'
outlet_table_oid = '.1.3.6.1.4.1.534.6.6.6.1.2.2.1.1'
@@ -52,7 +52,7 @@ class EatonManagedePDU:
# Switched ePDU (Pulizzi 2)
# NOTE: sysOID reports "20677.1", while data are actually at "20677.2"
-class EatonSwitchedePDU:
+class EatonSwitchedePDU(object):
status_oid = '.1.3.6.1.4.1.20677.2.6.3.%d.0'
control_oid = '.1.3.6.1.4.1.20677.2.6.2.%d.0'
outlet_table_oid = '.1.3.6.1.4.1.20677.2.6.3'
diff --git a/fence/agents/ipdu/fence_ipdu.py b/fence/agents/ipdu/fence_ipdu.py
index 479e9b8..913322d 100644
--- a/fence/agents/ipdu/fence_ipdu.py
+++ b/fence/agents/ipdu/fence_ipdu.py
@@ -32,7 +32,7 @@ port_id = None
switch_id = None
# Classes describing Device params
-class IBMiPDU:
+class IBMiPDU(object):
# iPDU
status_oid = '.1.3.6.1.4.1.2.6.223.8.2.2.1.11.%d'
control_oid = '.1.3.6.1.4.1.2.6.223.8.2.2.1.11.%d'
10 years
fence-agents: master - [cleanup] Add missing spaces
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=f136b9...
Commit: f136b9d40d79ffa57f384c8b896f71466ab7b554
Parent: 698691e42f383d971e62915fbe83c3801d1b9266
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Apr 9 23:15:36 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Apr 11 09:38:22 2014 +0200
[cleanup] Add missing spaces
---
fence/agents/lib/fencing.py.py | 2 +-
fence/agents/ovh/fence_ovh.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 7d2994f..32040db 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -392,7 +392,7 @@ class fspawn(pexpect.spawn):
def send(self, message):
logging.debug("Sent: %s" % message)
- pexpect.spawn.send(self,message)
+ pexpect.spawn.send(self, message)
# send EOL according to what was detected in login process (telnet)
def send_eol(self, message):
diff --git a/fence/agents/ovh/fence_ovh.py b/fence/agents/ovh/fence_ovh.py
index cd33b17..24c3972 100644
--- a/fence/agents/ovh/fence_ovh.py
+++ b/fence/agents/ovh/fence_ovh.py
@@ -113,11 +113,11 @@ Poweroff is simulated with a reboot into rescue-pro mode."
if options["--action"] == 'off':
# Reboot in Rescue-pro
- netboot_reboot(options,OVH_RESCUE_PRO_NETBOOT_ID)
+ netboot_reboot(options, OVH_RESCUE_PRO_NETBOOT_ID)
time.sleep(STATUS_RESCUE_PRO_SLEEP)
elif options["--action"] in ['on', 'reboot' ]:
# Reboot from HD
- netboot_reboot(options,OVH_HARD_DISK_NETBOOT_ID)
+ netboot_reboot(options, OVH_HARD_DISK_NETBOOT_ID)
time.sleep(STATUS_HARD_DISK_SLEEP)
# Save datetime just after reboot
10 years
fence-agents: master - fencing: Refactor access to 3rd-party binaries
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=698691...
Commit: 698691e42f383d971e62915fbe83c3801d1b9266
Parent: b4125861985a9574d9e199821d45a248ec581d49
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Apr 11 09:37:36 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Apr 11 09:37:36 2014 +0200
fencing: Refactor access to 3rd-party binaries
Previously, we had just one fence agent of that type that was ported to
fencing library. Now, there are fence_amt and fence_ipmilan so it is possible
to create a more generic version of such access.
---
fence/agents/amt/fence_amt.py | 55 +++---------------------------
fence/agents/ipmilan/fence_ipmilan.py | 58 ++++-----------------------------
fence/agents/lib/fencing.py.py | 20 +++++++++++
3 files changed, 33 insertions(+), 100 deletions(-)
diff --git a/fence/agents/amt/fence_amt.py b/fence/agents/amt/fence_amt.py
index fdf2db3..dc2fd12 100644
--- a/fence/agents/amt/fence_amt.py
+++ b/fence/agents/amt/fence_amt.py
@@ -1,12 +1,11 @@
#!/usr/bin/python -tt
-import sys, subprocess, re
-import logging
+import sys, re
import atexit
from pipes import quote
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
-from fencing import fail_usage, is_executable, SUDO_PATH
+from fencing import fail_usage, is_executable, SUDO_PATH, run_command
#BEGIN_VERSION_GENERATION
RELEASE_VERSION="Fence agent for Intel AMT"
@@ -15,22 +14,8 @@ BUILD_DATE=""
#END_VERSION_GENERATION
def get_power_status(_, options):
- cmd = create_command(options, "status")
-
- try:
- logging.debug("Running: %s" % cmd)
- process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
- except OSError:
- fail_usage("Amttool not found or not accessible")
-
- process.wait()
-
- out = process.communicate()
- process.stdout.close()
- process.stderr.close()
- logging.debug("%s\n" % str(out))
-
- match = re.search('Powerstate:[\\s]*(..)', str(out))
+ output = run_command(options, create_command(options, "status"))
+ match = re.search('Powerstate:[\\s]*(..)', str(output))
status = match.group(1) if match else None
if (status == None):
@@ -41,39 +26,11 @@ def get_power_status(_, options):
return "off"
def set_power_status(_, options):
- cmd = create_command(options, options["--action"])
-
- try:
- logging.debug("Running: %s" % cmd)
- process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
- except OSError:
- fail_usage("Amttool not found or not accessible")
-
- process.wait()
-
- out = process.communicate()
- process.stdout.close()
- process.stderr.close()
- logging.debug("%s\n" % str(out))
-
+ run_command(options, create_command(options, options["--action"]))
return
def reboot_cycle(_, options):
- cmd = create_command(options, "cycle")
-
- try:
- logging.debug("Running: %s" % cmd)
- process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
- except OSError:
- fail_usage("Amttool not found or not accessible")
-
- status = process.wait()
-
- out = process.communicate()
- process.stdout.close()
- process.stderr.close()
- logging.debug("%s\n" % str(out))
-
+ (status, _, _) = run_command(options, create_command(options, "cycle"))
return not bool(status)
def create_command(options, action):
diff --git a/fence/agents/ipmilan/fence_ipmilan.py b/fence/agents/ipmilan/fence_ipmilan.py
index 9357369..d7b0f18 100644
--- a/fence/agents/ipmilan/fence_ipmilan.py
+++ b/fence/agents/ipmilan/fence_ipmilan.py
@@ -1,12 +1,11 @@
#!/usr/bin/python -tt
-import sys, shlex, subprocess, re, os
-import logging
+import sys, re, os
import atexit
from pipes import quote
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
-from fencing import SUDO_PATH, fail_usage, is_executable
+from fencing import SUDO_PATH, fail_usage, is_executable, run_command
#BEGIN_VERSION_GENERATION
RELEASE_VERSION=""
@@ -15,61 +14,18 @@ BUILD_DATE=""
#END_VERSION_GENERATION
def get_power_status(_, options):
- cmd = create_command(options, "status")
-
- try:
- logging.info("Executing: %s\n" % cmd)
- process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- except OSError:
- fail_usage("Ipmitool not found or not accessible")
-
- process.wait()
-
- out = process.communicate()
- process.stdout.close()
- process.stderr.close()
- logging.debug("%s\n" % str(out))
-
- match = re.search('[Cc]hassis [Pp]ower is [\\s]*([a-zA-Z]{2,3})', str(out))
+ output = run_command(options, create_command(options, "status"))
+ match = re.search('[Cc]hassis [Pp]ower is [\\s]*([a-zA-Z]{2,3})', str(output))
status = match.group(1) if match else None
-
return status
def set_power_status(_, options):
- cmd = create_command(options, options["--action"])
-
- try:
- logging.debug("Executing: %s\n" % cmd)
- process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- except OSError:
- fail_usage("Ipmitool not found or not accessible")
-
- process.wait()
-
- out = process.communicate()
- process.stdout.close()
- process.stderr.close()
- logging.debug("%s\n" % str(out))
-
+ run_command(options, create_command(options, options["--action"]))
return
def reboot_cycle(_, options):
- cmd = create_command(options, "cycle")
-
- try:
- logging.debug("Executing: %s\n" % cmd)
- process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- except OSError:
- fail_usage("Ipmitool not found or not accessible")
-
- process.wait()
-
- out = process.communicate()
- process.stdout.close()
- process.stderr.close()
- logging.debug("%s\n" % str(out))
-
- return bool(re.search('chassis power control: cycle', str(out).lower()))
+ output = run_command(options, create_command(options, "cycle"))
+ return bool(re.search('chassis power control: cycle', str(output).lower()))
def create_command(options, action):
cmd = options["--ipmitool-path"]
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index f243202..7d2994f 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -3,6 +3,8 @@
import sys, getopt, time, os, uuid, pycurl, stat
import pexpect, re, atexit, syslog
import logging
+import subprocess
+import shlex
import __main__
## do not add code here.
@@ -1091,3 +1093,21 @@ def is_executable(path):
if stat.S_ISREG(stats.st_mode) and os.access(path, os.X_OK):
return True
return False
+
+def run_command(options, command):
+ # @todo: Use timeouts from options[]
+ logging.info("Executing: %s\n" % command)
+
+ try:
+ process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ except OSError, ex:
+ fail_usage("Unable to run %s\n" % command)
+
+ status = process.wait()
+ (pipe_stdout, pipe_stderr) = process.communicate()
+ process.stdout.close()
+ process.stderr.close()
+
+ logging.debug("%s %s %s\n" % str(status), str(pipe_stdout), str(pipe_stderr))
+
+ return (status, pipe_stdout, pipe_stderr)
10 years
fence-agents: master - fence_ipmilan: send empty password, if password is not entered
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=b41258...
Commit: b4125861985a9574d9e199821d45a248ec581d49
Parent: 5099295082968d62a53452642ee8dbe02b6b0e32
Author: Ondrej Mular <omular(a)redhat.com>
AuthorDate: Thu Apr 3 08:44:19 2014 -0400
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Apr 11 09:30:27 2014 +0200
fence_ipmilan: send empty password, if password is not entered
Previously, agent stuck on password prompt from ipmitool, if password was not specified.
Resolves: rhbz#1083600
---
fence/agents/ipmilan/fence_ipmilan.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fence/agents/ipmilan/fence_ipmilan.py b/fence/agents/ipmilan/fence_ipmilan.py
index a57efb7..9357369 100644
--- a/fence/agents/ipmilan/fence_ipmilan.py
+++ b/fence/agents/ipmilan/fence_ipmilan.py
@@ -93,6 +93,8 @@ def create_command(options, action):
# --password / -p
if options.has_key("--password"):
cmd += " -P " + quote(options["--password"])
+ else:
+ cmd += " -P ''"
# --cipher / -C
cmd += " -C " + options["--cipher"]
10 years
fence-agents: master - [cleanup] remove LOG_MODE_*
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=509929...
Commit: 5099295082968d62a53452642ee8dbe02b6b0e32
Parent: 28742ec6688175c8af15475e5bc8333337bce494
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Apr 9 17:17:11 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Apr 9 17:17:11 2014 +0200
[cleanup] remove LOG_MODE_*
These constants can be removed because they were replaced by logging.* subsystem.
---
fence/agents/amt/fence_amt.py | 2 +-
fence/agents/cisco_ucs/fence_cisco_ucs.py | 2 +-
fence/agents/eps/fence_eps.py | 2 +-
fence/agents/ipmilan/fence_ipmilan.py | 2 +-
fence/agents/lib/fencing.py.py | 3 ---
fence/agents/lib/fencing_snmp.py.py | 2 +-
fence/agents/rhevm/fence_rhevm.py | 2 +-
fence/agents/vmware/fence_vmware.py | 2 +-
8 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/fence/agents/amt/fence_amt.py b/fence/agents/amt/fence_amt.py
index 0eb6caf..fdf2db3 100644
--- a/fence/agents/amt/fence_amt.py
+++ b/fence/agents/amt/fence_amt.py
@@ -6,7 +6,7 @@ import atexit
from pipes import quote
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
-from fencing import fail_usage, is_executable, SUDO_PATH, LOG_MODE_VERBOSE
+from fencing import fail_usage, is_executable, SUDO_PATH
#BEGIN_VERSION_GENERATION
RELEASE_VERSION="Fence agent for Intel AMT"
diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py
index de0f681..2d4eaa8 100644
--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py
+++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py
@@ -7,7 +7,7 @@ import time
import atexit
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
-from fencing import fail, EC_STATUS, EC_LOGIN_DENIED, LOG_MODE_VERBOSE
+from fencing import fail, EC_STATUS, EC_LOGIN_DENIED
#BEGIN_VERSION_GENERATION
RELEASE_VERSION="New Cisco UCS Agent - test release on steroids"
diff --git a/fence/agents/eps/fence_eps.py b/fence/agents/eps/fence_eps.py
index 3a52b3c..5efc8df 100644
--- a/fence/agents/eps/fence_eps.py
+++ b/fence/agents/eps/fence_eps.py
@@ -9,7 +9,7 @@ import logging
import atexit
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
-from fencing import fail, fail_usage, EC_LOGIN_DENIED, EC_TIMED_OUT, LOG_MODE_VERBOSE
+from fencing import fail, fail_usage, EC_LOGIN_DENIED, EC_TIMED_OUT
#BEGIN_VERSION_GENERATION
RELEASE_VERSION="ePowerSwitch 8M+ (eps)"
diff --git a/fence/agents/ipmilan/fence_ipmilan.py b/fence/agents/ipmilan/fence_ipmilan.py
index b120d6b..a57efb7 100644
--- a/fence/agents/ipmilan/fence_ipmilan.py
+++ b/fence/agents/ipmilan/fence_ipmilan.py
@@ -6,7 +6,7 @@ import atexit
from pipes import quote
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
-from fencing import SUDO_PATH, LOG_MODE_VERBOSE, fail_usage, is_executable
+from fencing import SUDO_PATH, fail_usage, is_executable
#BEGIN_VERSION_GENERATION
RELEASE_VERSION=""
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 73c2c4a..f243202 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -15,9 +15,6 @@ BUILD_DATE = "March, 2008"
__all__ = [ 'atexit_handler', 'check_input', 'process_input', 'all_opt', 'show_docs',
'fence_login', 'fence_action' ]
-LOG_MODE_VERBOSE = 100
-LOG_MODE_QUIET = 0
-
EC_GENERIC_ERROR = 1
EC_BAD_ARGS = 2
EC_LOGIN_DENIED = 3
diff --git a/fence/agents/lib/fencing_snmp.py.py b/fence/agents/lib/fencing_snmp.py.py
index d8dd746..9ebdcbc 100644
--- a/fence/agents/lib/fencing_snmp.py.py
+++ b/fence/agents/lib/fencing_snmp.py.py
@@ -5,7 +5,7 @@
import re, pexpect
import logging
from fencing import *
-from fencing import fail, fail_usage, EC_TIMED_OUT, LOG_MODE_VERBOSE
+from fencing import fail, fail_usage, EC_TIMED_OUT
__all__ = [ 'FencingSnmp' ]
diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
index 767c098..54af81b 100644
--- a/fence/agents/rhevm/fence_rhevm.py
+++ b/fence/agents/rhevm/fence_rhevm.py
@@ -6,7 +6,7 @@ import logging
import atexit
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
-from fencing import fail, EC_STATUS, LOG_MODE_VERBOSE
+from fencing import fail, EC_STATUS
#BEGIN_VERSION_GENERATION
RELEASE_VERSION="New RHEV-M Agent - test release on steroids"
diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py
index c9310fb..b5cca48 100644
--- a/fence/agents/vmware/fence_vmware.py
+++ b/fence/agents/vmware/fence_vmware.py
@@ -27,7 +27,7 @@ import logging
import atexit
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
-from fencing import fail, fail_usage, EC_TIMED_OUT, LOG_MODE_VERBOSE
+from fencing import fail, fail_usage, EC_TIMED_OUT
#BEGIN_VERSION_GENERATION
RELEASE_VERSION="VMware Agent using VI Perl API and/or VIX vmrun command"
10 years
fence-agents: master - [cleanup] fence_wti: Fix variables that can be used before assignement
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=28742e...
Commit: 28742ec6688175c8af15475e5bc8333337bce494
Parent: 24226ad4008ec1c0aceaa8f3612b1114516d6847
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Apr 9 17:11:39 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Apr 9 17:11:39 2014 +0200
[cleanup] fence_wti: Fix variables that can be used before assignement
---
fence/agents/wti/fence_wti.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index 34d85a1..9d49854 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -92,6 +92,10 @@ def get_plug_group_status(conn, options):
outlets = {}
line_index = 0
+ status_index = -1
+ plug_index = -1
+ name_index = -1
+
lines = listing.splitlines()
while line_index < len(lines) and line_index >= 0:
line = lines[line_index]
10 years