cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Marek 'marx' Grac <mgrac@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 07/15] [cleanup] Only symbols that should be used are exported from fencing library
Date: Wed,  2 Apr 2014 13:52:15 +0200	[thread overview]
Message-ID: <1396439543-29533-7-git-send-email-mgrac@redhat.com> (raw)
In-Reply-To: <1396439543-29533-1-git-send-email-mgrac@redhat.com>

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



  parent reply	other threads:[~2014-04-02 11:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 11:52 [Cluster-devel] [PATCH 01/15] [cleanup] Add missing spaces and fix tab/spaces indentation Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 02/15] [cleanup] Proper import of atexit Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 03/15] [cleanup] Remove unused variables Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 04/15] [cleanup] Split lines that were too long Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 05/15] [cleanup] Remove unused dependencies Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 06/15] [cleanup] Remove problems with redefining variables/functions Marek 'marx' Grac
2014-04-02 11:52 ` Marek 'marx' Grac [this message]
2014-04-02 11:52 ` [Cluster-devel] [PATCH 08/15] [cleanup] Mark raw strings with r"" Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 09/15] [cleanup] Only symbols that should be used are exported from fencing_snmp library Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 10/15] [cleanup] Errors when encountering mixed space/tab in python Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 11/15] [cleanup] Mark raw strings with r"" in fence_virsh Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 12/15] [cleanup] Remove snmp_define_defaults() Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 13/15] [cleanup] Remove unused arguments Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 14/15] [cleanup] Remove transfer script used in transition 3.x->4.x Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 15/15] [cleanup] Fix invalid names of variables Marek 'marx' Grac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396439543-29533-7-git-send-email-mgrac@redhat.com \
    --to=mgrac@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).