[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 07/15] [cleanup] Only symbols that should be used are exported from fencing library



Previously, all symbols were exported what ends with redefining some symbols. Currently, the
wildcard (from fencing import *) imports only those that should be used. Rest of them make sense
for some fence agents (e.g. TELNET_PATH if we are not able to use regular fence_login) but there
are some symbols which have to be used before but they are not needed now. This will be solved later.
---
 fence/agents/amt/fence_amt.py                 | 1 +
 fence/agents/apc/fence_apc.py                 | 1 +
 fence/agents/bladecenter/fence_bladecenter.py | 1 +
 fence/agents/brocade/fence_brocade.py         | 1 +
 fence/agents/cisco_mds/fence_cisco_mds.py     | 1 +
 fence/agents/cisco_ucs/fence_cisco_ucs.py     | 2 ++
 fence/agents/drac5/fence_drac5.py             | 1 +
 fence/agents/dummy/fence_dummy.py             | 2 ++
 fence/agents/eps/fence_eps.py                 | 1 +
 fence/agents/hpblade/fence_hpblade.py         | 1 +
 fence/agents/ifmib/fence_ifmib.py             | 1 +
 fence/agents/ilo/fence_ilo.py                 | 1 +
 fence/agents/ipmilan/fence_ipmilan.py         | 1 +
 fence/agents/ldom/fence_ldom.py               | 1 +
 fence/agents/lib/fencing.py.py                | 3 +++
 fence/agents/lib/fencing_snmp.py.py           | 1 +
 fence/agents/lpar/fence_lpar.py               | 1 +
 fence/agents/netio/fence_netio.py             | 1 +
 fence/agents/ovh/fence_ovh.py                 | 1 +
 fence/agents/rhevm/fence_rhevm.py             | 1 +
 fence/agents/sanbox2/fence_sanbox2.py         | 1 +
 fence/agents/virsh/fence_virsh.py             | 2 ++
 fence/agents/vmware/fence_vmware.py           | 1 +
 fence/agents/vmware_soap/fence_vmware_soap.py | 1 +
 fence/agents/wti/fence_wti.py                 | 2 ++
 25 files changed, 31 insertions(+)

diff --git a/fence/agents/amt/fence_amt.py b/fence/agents/amt/fence_amt.py
index 1286bd9..346677e 100644
--- a/fence/agents/amt/fence_amt.py
+++ b/fence/agents/amt/fence_amt.py
@@ -5,6 +5,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
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="Fence agent for Intel AMT"
diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
index d976be6..76b544b 100644
--- a/fence/agents/apc/fence_apc.py
+++ b/fence/agents/apc/fence_apc.py
@@ -18,6 +18,7 @@ import sys, re
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, fail_usage, EC_STATUS
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New APC Agent - test release on steroids"
diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
index e94fd7d..34a8975 100644
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -16,6 +16,7 @@ import sys, re
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, EC_STATUS, EC_GENERIC_ERROR
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New Bladecenter Agent - test release on steroids"
diff --git a/fence/agents/brocade/fence_brocade.py b/fence/agents/brocade/fence_brocade.py
index 9e37e49..2deab5b 100644
--- a/fence/agents/brocade/fence_brocade.py
+++ b/fence/agents/brocade/fence_brocade.py
@@ -4,6 +4,7 @@ import sys, re
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, EC_STATUS
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New Brocade Agent - test release on steroids"
diff --git a/fence/agents/cisco_mds/fence_cisco_mds.py b/fence/agents/cisco_mds/fence_cisco_mds.py
index f6eed64..6af1e99 100644
--- a/fence/agents/cisco_mds/fence_cisco_mds.py
+++ b/fence/agents/cisco_mds/fence_cisco_mds.py
@@ -10,6 +10,7 @@ import sys, re
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail_usage
 from fencing_snmp import *
 
 #BEGIN_VERSION_GENERATION
diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py
index 388eda9..81a911e 100644
--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py
+++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py
@@ -2,9 +2,11 @@
 
 import sys, re
 import pycurl, StringIO
+import time
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, EC_STATUS, EC_LOGIN_DENIED, LOG_MODE_VERBOSE
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New Cisco UCS Agent - test release on steroids"
diff --git a/fence/agents/drac5/fence_drac5.py b/fence/agents/drac5/fence_drac5.py
index b95b1c7..642dcda 100644
--- a/fence/agents/drac5/fence_drac5.py
+++ b/fence/agents/drac5/fence_drac5.py
@@ -16,6 +16,7 @@ import sys, re, time
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail_usage
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New Drac5 Agent - test release on steroids"
diff --git a/fence/agents/dummy/fence_dummy.py b/fence/agents/dummy/fence_dummy.py
index fb79b1a..dc65bee 100644
--- a/fence/agents/dummy/fence_dummy.py
+++ b/fence/agents/dummy/fence_dummy.py
@@ -1,9 +1,11 @@
 #!/usr/bin/python
 
 import sys, random
+import time
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail_usage
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New Dummy Agent - test release on steroids"
diff --git a/fence/agents/eps/fence_eps.py b/fence/agents/eps/fence_eps.py
index 42e2be7..3c4be8d 100644
--- a/fence/agents/eps/fence_eps.py
+++ b/fence/agents/eps/fence_eps.py
@@ -8,6 +8,7 @@ import httplib, base64, string, socket
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, fail_usage, EC_LOGIN_DENIED, EC_TIMED_OUT, LOG_MODE_VERBOSE
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="ePowerSwitch 8M+ (eps)"
diff --git a/fence/agents/hpblade/fence_hpblade.py b/fence/agents/hpblade/fence_hpblade.py
index 84e0b0b..44032d3 100644
--- a/fence/agents/hpblade/fence_hpblade.py
+++ b/fence/agents/hpblade/fence_hpblade.py
@@ -10,6 +10,7 @@ import sys, re
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, EC_STATUS
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New Bladecenter Agent - test release on steroids"
diff --git a/fence/agents/ifmib/fence_ifmib.py b/fence/agents/ifmib/fence_ifmib.py
index 1273b0e..3ecc85d 100644
--- a/fence/agents/ifmib/fence_ifmib.py
+++ b/fence/agents/ifmib/fence_ifmib.py
@@ -12,6 +12,7 @@ import sys
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail_usage
 from fencing_snmp import *
 
 #BEGIN_VERSION_GENERATION
diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
index 48c829d..8171958 100644
--- a/fence/agents/ilo/fence_ilo.py
+++ b/fence/agents/ilo/fence_ilo.py
@@ -16,6 +16,7 @@ import atexit
 from xml.sax.saxutils import quoteattr
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, EC_LOGIN_DENIED
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New ILO Agent - test release on steroids"
diff --git a/fence/agents/ipmilan/fence_ipmilan.py b/fence/agents/ipmilan/fence_ipmilan.py
index 7254c73..c5cab2b 100644
--- a/fence/agents/ipmilan/fence_ipmilan.py
+++ b/fence/agents/ipmilan/fence_ipmilan.py
@@ -5,6 +5,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
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION=""
diff --git a/fence/agents/ldom/fence_ldom.py b/fence/agents/ldom/fence_ldom.py
index 1bf1c49..ffa8fe4 100644
--- a/fence/agents/ldom/fence_ldom.py
+++ b/fence/agents/ldom/fence_ldom.py
@@ -11,6 +11,7 @@ import sys, re, pexpect, exceptions
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail_usage
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="Logical Domains (LDoms) fence Agent"
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 6aab45b..40ee919 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -11,6 +11,9 @@ REDHAT_COPYRIGHT = ""
 BUILD_DATE = "March, 2008"
 #END_VERSION_GENERATION
 
+__all__ = [ 'atexit_handler', 'check_input', 'process_input', 'all_opt', 'show_docs',
+		'fence_login', 'fence_action' ]
+
 LOG_MODE_VERBOSE = 100
 LOG_MODE_QUIET = 0
 
diff --git a/fence/agents/lib/fencing_snmp.py.py b/fence/agents/lib/fencing_snmp.py.py
index 3faa295..a081052 100644
--- a/fence/agents/lib/fencing_snmp.py.py
+++ b/fence/agents/lib/fencing_snmp.py.py
@@ -4,6 +4,7 @@
 
 import re, pexpect
 from fencing import *
+from fencing import fail, fail_usage, EC_TIMED_OUT, LOG_MODE_VERBOSE
 
 ## do not add code here.
 #BEGIN_VERSION_GENERATION
diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py
index 05e9b28..4278650 100644
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -14,6 +14,7 @@ import sys, re
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, fail_usage, EC_STATUS_HMC
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION=""
diff --git a/fence/agents/netio/fence_netio.py b/fence/agents/netio/fence_netio.py
index e483470..a1b4abf 100755
--- a/fence/agents/netio/fence_netio.py
+++ b/fence/agents/netio/fence_netio.py
@@ -4,6 +4,7 @@ import sys, re, pexpect
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fspawn, fail, EC_LOGIN_DENIED, TELNET_PATH
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION=""
diff --git a/fence/agents/ovh/fence_ovh.py b/fence/agents/ovh/fence_ovh.py
index 647343c..9b1b373 100644
--- a/fence/agents/ovh/fence_ovh.py
+++ b/fence/agents/ovh/fence_ovh.py
@@ -16,6 +16,7 @@ from suds.client import Client
 from suds.xsd.doctor import ImportDoctor, Import
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, fail_usage, EC_LOGIN_DENIED
 
 OVH_RESCUE_PRO_NETBOOT_ID = '28'
 OVH_HARD_DISK_NETBOOT_ID  = '1'
diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
index 9620c3a..ea10d4b 100644
--- a/fence/agents/rhevm/fence_rhevm.py
+++ b/fence/agents/rhevm/fence_rhevm.py
@@ -5,6 +5,7 @@ import pycurl, StringIO
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, EC_STATUS, LOG_MODE_VERBOSE
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New RHEV-M Agent - test release on steroids"
diff --git a/fence/agents/sanbox2/fence_sanbox2.py b/fence/agents/sanbox2/fence_sanbox2.py
index e0c0647..a9d7c76 100644
--- a/fence/agents/sanbox2/fence_sanbox2.py
+++ b/fence/agents/sanbox2/fence_sanbox2.py
@@ -12,6 +12,7 @@ import sys, re, pexpect, exceptions
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, EC_TIMED_OUT, EC_GENERIC_ERROR
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New Sanbox2 Agent - test release on steroids"
diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py
index 170c089..fa6993e 100644
--- a/fence/agents/virsh/fence_virsh.py
+++ b/fence/agents/virsh/fence_virsh.py
@@ -6,9 +6,11 @@
 #
 
 import sys, re
+import time
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail_usage, SUDO_PATH
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="Virsh fence agent"
diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py
index f0f6023..9f19cb9 100644
--- a/fence/agents/vmware/fence_vmware.py
+++ b/fence/agents/vmware/fence_vmware.py
@@ -26,6 +26,7 @@ import sys, re, pexpect
 import atexit
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fail, fail_usage, EC_TIMED_OUT, LOG_MODE_VERBOSE
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="VMware Agent using VI Perl API and/or VIX vmrun command"
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index b55b56c..f944a04 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -9,6 +9,7 @@ sys.path.append("@FENCEAGENTSLIBDIR@")
 from suds.client import Client
 from suds.sudsobject import Property
 from fencing import *
+from fencing import fail, EC_STATUS, EC_LOGIN_DENIED, EC_INVALID_PRIVILEGES, EC_WAITING_ON, EC_WAITING_OFF
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New VMWare Agent - test release on steroids"
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index bcb287b..da68b66 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -13,8 +13,10 @@
 
 import sys, re, pexpect
 import atexit
+import time
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
+from fencing import fspawn, fail, fail_usage, TELNET_PATH, EC_LOGIN_DENIED
 
 #BEGIN_VERSION_GENERATION
 RELEASE_VERSION="New WTI Agent - test release on steroids"
-- 
1.9.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]