summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Client/Frame.py14
-rw-r--r--src/lib/Client/Tools/APT.py2
-rw-r--r--src/lib/Client/Tools/Action.py2
-rw-r--r--src/lib/Client/Tools/Blast.py2
-rw-r--r--src/lib/Client/Tools/Chkconfig.py2
-rw-r--r--src/lib/Client/Tools/DebInit.py2
-rw-r--r--src/lib/Client/Tools/Encap.py2
-rw-r--r--src/lib/Client/Tools/FreeBSDInit.py2
-rw-r--r--src/lib/Client/Tools/FreeBSDPackage.py2
-rw-r--r--src/lib/Client/Tools/POSIX.py2
-rw-r--r--src/lib/Client/Tools/Portage.py2
-rw-r--r--src/lib/Client/Tools/RPM.py2
-rw-r--r--src/lib/Client/Tools/RPMng.py38
-rw-r--r--src/lib/Client/Tools/RcUpdate.py2
-rw-r--r--src/lib/Client/Tools/SMF.py2
-rw-r--r--src/lib/Client/Tools/SYSV.py2
-rw-r--r--src/lib/Client/Tools/YUMng.py2
-rw-r--r--src/lib/Client/Tools/Yum.py2
-rw-r--r--src/lib/Client/Tools/__init__.py8
-rw-r--r--src/lib/Client/Tools/launchd.py2
20 files changed, 47 insertions, 47 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index 6d778f6ba..71c4addc8 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -83,10 +83,10 @@ class Frame:
for tool in self.tools[:]:
for conflict in getattr(tool, 'conflicts', []):
[self.tools.remove(item) for item in self.tools \
- if item.__name__ == conflict]
+ if item.name == conflict]
self.logger.info("Loaded tool drivers:")
- self.logger.info([tool.__name__ for tool in self.tools])
+ self.logger.info([tool.name for tool in self.tools])
if not self.dryrun and not self.setup['bundle']:
for cfile in [cfl for cfl in config.findall(".//ConfigFile") \
if cfl.get('name') in self.__important__]:
@@ -142,7 +142,7 @@ class Frame:
try:
tool.Inventory(self.states)
except:
- self.logger.error("%s.Inventory() call failed:" % tool.__name__, exc_info=1)
+ self.logger.error("%s.Inventory() call failed:" % tool.name, exc_info=1)
def Decide(self):
'''Set self.whitelist based on user interaction'''
@@ -239,7 +239,7 @@ class Frame:
try:
tool.Install(handled, self.states)
except:
- self.logger.error("%s.Install() call failed:" % tool.__name__, exc_info=1)
+ self.logger.error("%s.Install() call failed:" % tool.name, exc_info=1)
def Install(self):
'''Install all entries'''
@@ -259,7 +259,7 @@ class Frame:
try:
tool.Inventory(self.states, [bundle])
except:
- self.logger.error("%s.Inventory() call failed:" % tool.__name__, exc_info=1)
+ self.logger.error("%s.Inventory() call failed:" % tool.name, exc_info=1)
clobbered = [entry for bundle in mbundles for entry in bundle \
if not self.states[entry] and entry not in self.blacklist]
if clobbered:
@@ -278,7 +278,7 @@ class Frame:
tool.BundleNotUpdated(bundle, self.states)
except:
self.logger.error("%s.BundleNotUpdated() call failed:" % \
- (tool.__name__), exc_info=1)
+ (tool.name), exc_info=1)
def Remove(self):
'''Remove extra entries'''
@@ -288,7 +288,7 @@ class Frame:
try:
tool.Remove(extras)
except:
- self.logger.error("%s.Remove() failed" % tool.__name__, exc_info=1)
+ self.logger.error("%s.Remove() failed" % tool.name, exc_info=1)
def CondDisplayState(self, phase):
'''Conditionally print tracing information'''
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index 675f285b4..82819c564 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -8,7 +8,7 @@ import Bcfg2.Client.Tools
class APT(Bcfg2.Client.Tools.Tool):
'''The Debian toolset implements package and service operations and inherits
the rest from Toolset.Toolset'''
- __name__ = 'APT'
+ name = 'APT'
__execs__ = ['/usr/bin/debsums', '/usr/bin/apt-get', '/usr/bin/dpkg']
__important__ = ["/etc/apt/sources.list",
"/var/cache/debconf/config.dat",
diff --git a/src/lib/Client/Tools/Action.py b/src/lib/Client/Tools/Action.py
index 9ec3418e9..5f2e7b34f 100644
--- a/src/lib/Client/Tools/Action.py
+++ b/src/lib/Client/Tools/Action.py
@@ -10,7 +10,7 @@ import Bcfg2.Client.Tools
class Action(Bcfg2.Client.Tools.Tool):
'''Implement Actions'''
- __name__ = 'Action'
+ name = 'Action'
__handles__ = [('PostInstall', None), ('Action', None)]
__req__ = {'PostInstall': ['name'],
'Action':['name', 'timing', 'when', 'command', 'status']}
diff --git a/src/lib/Client/Tools/Blast.py b/src/lib/Client/Tools/Blast.py
index c1286844c..6eb330c60 100644
--- a/src/lib/Client/Tools/Blast.py
+++ b/src/lib/Client/Tools/Blast.py
@@ -8,7 +8,7 @@ class Blast(Bcfg2.Client.Tools.SYSV.SYSV):
'''Support for Blastwave packages'''
pkgtype = 'blast'
pkgtool = ("/opt/csw/bin/pkg-get install %s", ("%s", ["bname"]))
- __name__ = 'Blast'
+ name = 'Blast'
__execs__ = ['/opt/csw/bin/pkg-get', "/usr/bin/pkginfo"]
__handles__ = [('Package', 'blast')]
__ireq__ = {'Package': ['name', 'version', 'bname']}
diff --git a/src/lib/Client/Tools/Chkconfig.py b/src/lib/Client/Tools/Chkconfig.py
index 02e01bb32..ae3beaecb 100644
--- a/src/lib/Client/Tools/Chkconfig.py
+++ b/src/lib/Client/Tools/Chkconfig.py
@@ -8,7 +8,7 @@ import Bcfg2.Client.Tools, Bcfg2.Client.XML
class Chkconfig(Bcfg2.Client.Tools.SvcTool):
'''Chkconfig support for Bcfg2'''
- __name__ = 'Chkconfig'
+ name = 'Chkconfig'
__execs__ = ['/sbin/chkconfig']
__handles__ = [('Service', 'chkconfig')]
__req__ = {'Service': ['name', 'status']}
diff --git a/src/lib/Client/Tools/DebInit.py b/src/lib/Client/Tools/DebInit.py
index f23046273..b18c11cd5 100644
--- a/src/lib/Client/Tools/DebInit.py
+++ b/src/lib/Client/Tools/DebInit.py
@@ -6,7 +6,7 @@ import Bcfg2.Client.Tools
class DebInit(Bcfg2.Client.Tools.SvcTool):
'''Debian Service Support for Bcfg2'''
- __name__ = 'DebInit'
+ name = 'DebInit'
__execs__ = ['/usr/sbin/update-rc.d']
__handles__ = [('Service', 'deb')]
__req__ = {'Service': ['name', 'status']}
diff --git a/src/lib/Client/Tools/Encap.py b/src/lib/Client/Tools/Encap.py
index 24e124103..520689da2 100644
--- a/src/lib/Client/Tools/Encap.py
+++ b/src/lib/Client/Tools/Encap.py
@@ -6,7 +6,7 @@ import Bcfg2.Client.Tools, glob, re
class Encap(Bcfg2.Client.Tools.PkgTool):
'''Support for Encap packages'''
- __name__ = 'Encap'
+ name = 'Encap'
__execs__ = ['/usr/local/bin/epkg']
__handles__ = [('Package', 'encap')]
__req__ = {'Package': ['version', 'url']}
diff --git a/src/lib/Client/Tools/FreeBSDInit.py b/src/lib/Client/Tools/FreeBSDInit.py
index 695698f4c..4f5131fb5 100644
--- a/src/lib/Client/Tools/FreeBSDInit.py
+++ b/src/lib/Client/Tools/FreeBSDInit.py
@@ -9,7 +9,7 @@ import Bcfg2.Client.Tools
class FreeBSDInit(Bcfg2.Client.Tools.SvcTool):
'''FreeBSD Service Support for Bcfg2'''
- __name__ = 'FreeBSDInit'
+ name = 'FreeBSDInit'
__handles__ = [('Service', 'freebsd')]
__req__ = {'Service': ['name', 'status']}
__svcrestart__ = 'restart'
diff --git a/src/lib/Client/Tools/FreeBSDPackage.py b/src/lib/Client/Tools/FreeBSDPackage.py
index b77838f9d..117873c9f 100644
--- a/src/lib/Client/Tools/FreeBSDPackage.py
+++ b/src/lib/Client/Tools/FreeBSDPackage.py
@@ -11,7 +11,7 @@ import Bcfg2.Client.Tools
class FreeBSDPackage(Bcfg2.Client.Tools.PkgTool):
'''The FreeBSD toolset implements package operations and inherits
the rest from Toolset.Toolset'''
- __name__ = 'FreeBSDPackage'
+ name = 'FreeBSDPackage'
__execs__ = ['/usr/sbin/pkg_add', '/usr/sbin/pkg_info']
__handles__ = [('Package', 'freebsdpkg')]
__req__ = {'Package': ['name', 'version']}
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py
index 6f3e4cb59..17bb0a4f4 100644
--- a/src/lib/Client/Tools/POSIX.py
+++ b/src/lib/Client/Tools/POSIX.py
@@ -61,7 +61,7 @@ def isString(strng):
class POSIX(Bcfg2.Client.Tools.Tool):
'''POSIX File support code'''
- __name__ = 'POSIX'
+ name = 'POSIX'
__handles__ = [('ConfigFile', None), ('Directory', None), ('Permissions', None), \
('SymLink', None)]
__req__ = {'ConfigFile': ['name', 'owner', 'group', 'perms'],
diff --git a/src/lib/Client/Tools/Portage.py b/src/lib/Client/Tools/Portage.py
index 02c88186b..b0599a60a 100644
--- a/src/lib/Client/Tools/Portage.py
+++ b/src/lib/Client/Tools/Portage.py
@@ -7,7 +7,7 @@ import Bcfg2.Client.Tools
class Portage(Bcfg2.Client.Tools.PkgTool):
'''The Gentoo toolset implements package and service operations and inherits
the rest from Toolset.Toolset'''
- __name__ = 'Portage'
+ name = 'Portage'
__execs__ = ['/usr/bin/emerge', '/usr/bin/equery']
__important__ = ['/etc/make.conf']
__handles__ = [('Package', 'ebuild')]
diff --git a/src/lib/Client/Tools/RPM.py b/src/lib/Client/Tools/RPM.py
index 8f02596e3..be8bb95b9 100644
--- a/src/lib/Client/Tools/RPM.py
+++ b/src/lib/Client/Tools/RPM.py
@@ -6,7 +6,7 @@ import Bcfg2.Client.Tools, time
class RPM(Bcfg2.Client.Tools.PkgTool):
'''Support for RPM packages'''
- __name__ = 'RPM'
+ name = 'RPM'
__execs__ = ['/bin/rpm', '/var/lib/rpm']
__handles__ = [('Package', 'rpm')]
__req__ = {'Package': ['name', 'version']}
diff --git a/src/lib/Client/Tools/RPMng.py b/src/lib/Client/Tools/RPMng.py
index 858a71eef..1a7a0e21f 100644
--- a/src/lib/Client/Tools/RPMng.py
+++ b/src/lib/Client/Tools/RPMng.py
@@ -11,7 +11,7 @@ except NameError:
class RPMng(Bcfg2.Client.Tools.PkgTool):
'''Support for RPM packages'''
- __name__ = 'RPMng'
+ name = 'RPMng'
__execs__ = ['/bin/rpm', '/var/lib/rpm']
__handles__ = [('Package', 'rpm')]
@@ -48,8 +48,8 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
# installonlypackages
self.installOnlyPkgs = []
- if RPMng_CP.has_option(self.__name__, 'installonlypackages'):
- for i in RPMng_CP.get(self.__name__, 'installonlypackages').split(','):
+ if RPMng_CP.has_option(self.name, 'installonlypackages'):
+ for i in RPMng_CP.get(self.name, 'installonlypackages').split(','):
self.installOnlyPkgs.append(i.strip())
if self.installOnlyPkgs == []:
self.installOnlyPkgs = ['kernel', 'kernel-bigmem', 'kernel-enterprise', 'kernel-smp',
@@ -63,45 +63,45 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
# erase_flags
self.erase_flags = []
- if RPMng_CP.has_option(self.__name__, 'erase_flags'):
- for i in RPMng_CP.get(self.__name__, 'erase_flags').split(','):
+ if RPMng_CP.has_option(self.name, 'erase_flags'):
+ for i in RPMng_CP.get(self.name, 'erase_flags').split(','):
self.erase_flags.append(i.strip())
if self.erase_flags == []:
self.erase_flags = ['allmatches']
self.logger.debug('erase_flags = %s' % self.erase_flags)
# pkg_checks
- if RPMng_CP.has_option(self.__name__, 'pkg_checks'):
- self.pkg_checks = RPMng_CP.get(self.__name__, 'pkg_checks').lower()
+ if RPMng_CP.has_option(self.name, 'pkg_checks'):
+ self.pkg_checks = RPMng_CP.get(self.name, 'pkg_checks').lower()
else:
self.pkg_checks = 'true'
self.logger.debug('pkg_checks = %s' % self.pkg_checks)
# pkg_verify
- if RPMng_CP.has_option(self.__name__, 'pkg_verify'):
- self.pkg_verify = RPMng_CP.get(self.__name__, 'pkg_verify').lower()
+ if RPMng_CP.has_option(self.name, 'pkg_verify'):
+ self.pkg_verify = RPMng_CP.get(self.name, 'pkg_verify').lower()
else:
self.pkg_verify = 'true'
self.logger.debug('pkg_verify = %s' % self.pkg_verify)
# installed_action
- if RPMng_CP.has_option(self.__name__, 'installed_action'):
- self.installed_action = RPMng_CP.get(self.__name__, 'installed_action').lower()
+ if RPMng_CP.has_option(self.name, 'installed_action'):
+ self.installed_action = RPMng_CP.get(self.name, 'installed_action').lower()
else:
self.installed_action = 'install'
self.logger.debug('installed_action = %s' % self.installed_action)
# version_fail_action
- if RPMng_CP.has_option(self.__name__, 'version_fail_action'):
- self.version_fail_action = RPMng_CP.get(self.__name__, 'version_fail_action').lower()
+ if RPMng_CP.has_option(self.name, 'version_fail_action'):
+ self.version_fail_action = RPMng_CP.get(self.name, 'version_fail_action').lower()
else:
self.version_fail_action = 'upgrade'
self.logger.debug('version_fail_action = %s' % self.version_fail_action)
# verify_fail_action
- if self.__name__ == "RPMng":
- if RPMng_CP.has_option(self.__name__, 'verify_fail_action'):
- self.verify_fail_action = RPMng_CP.get(self.__name__, 'verify_fail_action').lower()
+ if self.name == "RPMng":
+ if RPMng_CP.has_option(self.name, 'verify_fail_action'):
+ self.verify_fail_action = RPMng_CP.get(self.name, 'verify_fail_action').lower()
else:
self.verify_fail_action = 'reinstall'
else: # yum can't reinstall packages.
@@ -109,8 +109,8 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
self.logger.debug('verify_fail_action = %s' % self.verify_fail_action)
# version_fail_action
- if RPMng_CP.has_option(self.__name__, 'verify_flags'):
- self.verify_flags = RPMng_CP.get(self.__name__, 'verify_flags').lower().split(',')
+ if RPMng_CP.has_option(self.name, 'verify_flags'):
+ self.verify_flags = RPMng_CP.get(self.name, 'verify_flags').lower().split(',')
else:
self.verify_flags = []
if '' in self.verify_flags:
@@ -503,7 +503,7 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
(inst_status.get('pkg').get('name'),
self.str_evra(instance)))
- elif inst_status.get('verify_fail', False) == True and self.__name__ == "RPMng":
+ elif inst_status.get('verify_fail', False) == True and self.name == "RPMng":
# yum can't reinstall packages so only do this for rpm.
if instance.get('verify_fail_action', 'reinstall') == "reinstall" and \
self.verify_fail_action == "reinstall":
diff --git a/src/lib/Client/Tools/RcUpdate.py b/src/lib/Client/Tools/RcUpdate.py
index 717099954..f0eec1bfe 100644
--- a/src/lib/Client/Tools/RcUpdate.py
+++ b/src/lib/Client/Tools/RcUpdate.py
@@ -5,7 +5,7 @@ import Bcfg2.Client.Tools, Bcfg2.Client.XML, commands, os
class RcUpdate(Bcfg2.Client.Tools.SvcTool):
'''RcUpdate support for Bcfg2'''
- __name__ = 'RcUpdate'
+ name = 'RcUpdate'
__execs__ = ['/sbin/rc-update', '/bin/rc-status']
__handles__ = [('Service', 'rc-update')]
__req__ = {'Service': ['name', 'status']}
diff --git a/src/lib/Client/Tools/SMF.py b/src/lib/Client/Tools/SMF.py
index 46d12757c..28f6c830c 100644
--- a/src/lib/Client/Tools/SMF.py
+++ b/src/lib/Client/Tools/SMF.py
@@ -8,7 +8,7 @@ class SMF(Bcfg2.Client.Tools.Tool):
'''Support for Solaris SMF Services'''
__handles__ = [('Service', 'smf')]
__execs__ = ['/usr/sbin/svcadm', '/usr/bin/svcs']
- __name__ = 'SMF'
+ name = 'SMF'
__req__ = {'Service':['name', 'status']}
__ireq__ = {'Service': ['name', 'status', 'FMRI']}
diff --git a/src/lib/Client/Tools/SYSV.py b/src/lib/Client/Tools/SYSV.py
index 6aa56331c..c6061366d 100644
--- a/src/lib/Client/Tools/SYSV.py
+++ b/src/lib/Client/Tools/SYSV.py
@@ -25,7 +25,7 @@ class SYSV(Bcfg2.Client.Tools.PkgTool):
__handles__ = [('Package', 'sysv')]
__req__ = {'Package': ['name', 'version']}
__ireq__ = {'Package': ['name', 'url', 'version']}
- __name__ = 'SYSV'
+ name = 'SYSV'
pkgtype = 'sysv'
pkgtool = ("/usr/sbin/pkgadd %s -n -d %%s", (('%s %s', ['url', 'name'])))
diff --git a/src/lib/Client/Tools/YUMng.py b/src/lib/Client/Tools/YUMng.py
index d41c27425..ec95e09ec 100644
--- a/src/lib/Client/Tools/YUMng.py
+++ b/src/lib/Client/Tools/YUMng.py
@@ -27,7 +27,7 @@ class YUMng(Bcfg2.Client.Tools.RPMng.RPMng):
'''Support for Yum packages'''
pkgtype = 'yum'
- __name__ = 'YUMng'
+ name = 'YUMng'
__execs__ = ['/usr/bin/yum', '/var/lib/rpm']
__handles__ = [('Package', 'yum'), ('Package', 'rpm')]
diff --git a/src/lib/Client/Tools/Yum.py b/src/lib/Client/Tools/Yum.py
index 65e664a6d..0986fca33 100644
--- a/src/lib/Client/Tools/Yum.py
+++ b/src/lib/Client/Tools/Yum.py
@@ -23,7 +23,7 @@ class Yum(Bcfg2.Client.Tools.RPM.RPM):
pkgtool = ("/usr/bin/yum -d0 -y install %s", ("%s-%s", ["name", "version"]))
else:
pkgtool = ("/usr/bin/yum -d0 install %s", ("%s-%s", ["name", "version"]))
- __name__ = 'Yum'
+ name = 'Yum'
__execs__ = ['/usr/bin/yum', '/var/lib/rpm']
__handles__ = [('Package', 'yum'), ('Package', 'rpm')]
__req__ = {'Package': ['name', 'version']}
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py
index dfe7abf38..22aeb664b 100644
--- a/src/lib/Client/Tools/__init__.py
+++ b/src/lib/Client/Tools/__init__.py
@@ -66,7 +66,7 @@ class Tool:
'''
All tools subclass this. It defines all interfaces that need to be defined
'''
- __name__ = 'Tool'
+ name = 'Tool'
__execs__ = []
__handles__ = []
__req__ = {}
@@ -88,7 +88,7 @@ class Tool:
mode = stat.S_IMODE(os.stat(filename)[stat.ST_MODE])
if mode & stat.S_IEXEC != stat.S_IEXEC:
self.logger.debug("%s: %s not executable" % \
- (self.__name__, filename))
+ (self.name, filename))
raise toolInstantiationError
except OSError:
raise toolInstantiationError
@@ -200,7 +200,7 @@ class PkgTool(Tool):
'''PkgTool provides a one-pass install with fallback for use with packaging systems'''
pkgtool = ('echo %s', ('%s', ['name']))
pkgtype = 'echo'
- __name__ = 'PkgTool'
+ name = 'PkgTool'
def __init__(self, logger, setup, config):
Tool.__init__(self, logger, setup, config)
@@ -277,7 +277,7 @@ class PkgTool(Tool):
class SvcTool(Tool):
'''This class defines basic Service behavior'''
- __name__ = 'SvcTool'
+ name = 'SvcTool'
__svcrestart__ = 'reload'
def BundleUpdated(self, bundle, states):
diff --git a/src/lib/Client/Tools/launchd.py b/src/lib/Client/Tools/launchd.py
index 2b9314e54..717a084a9 100644
--- a/src/lib/Client/Tools/launchd.py
+++ b/src/lib/Client/Tools/launchd.py
@@ -8,7 +8,7 @@ class launchd(Bcfg2.Client.Tools.Tool):
'''Support for Mac OS X Launchd Services'''
__handles__ = [('Service', 'launchd')]
__execs__ = ['/bin/launchctl', '/usr/bin/defaults']
- __name__ = 'launchd'
+ name = 'launchd'
__req__ = {'Service':['name', 'status']}
'''