summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-06-22 17:30:07 +0000
committerSol Jerome <sol.jerome@gmail.com>2010-06-22 12:30:16 -0500
commit224025473e2f37c684c80556fdeb8102ddaf3b13 (patch)
tree9f826c611860e76dabc732452a0160b0341a0160 /src/lib/Client
parent149301969d2256c36603aa6074383a4c5211610b (diff)
downloadbcfg2-224025473e2f37c684c80556fdeb8102ddaf3b13.tar.gz
bcfg2-224025473e2f37c684c80556fdeb8102ddaf3b13.tar.bz2
bcfg2-224025473e2f37c684c80556fdeb8102ddaf3b13.zip
Add the ability to specify important entries via info/info.xml
We currently have 'important' entries specified only inside the code for various client tools. This provides no room for growing that list outside of adding things to the code itself. With this change, users can now specify important entries via an additional attribute in their info.xml files. Signed-off-by: Sol Jerome <sol.jerome@gmail.com> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5957 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Tools/APT.py3
-rw-r--r--src/lib/Client/Tools/Portage.py2
-rw-r--r--src/lib/Client/Tools/YUMng.py3
-rw-r--r--src/lib/Client/Tools/__init__.py3
4 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index 8157d9e6c..1c035f956 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -47,7 +47,8 @@ class APT(Bcfg2.Client.Tools.Tool):
def __init__(self, logger, setup, config):
Bcfg2.Client.Tools.Tool.__init__(self, logger, setup, config)
- self.__important__ = ["%s/cache/debconf/config.dat" % var_path,
+ self.__important__ = self.__important__ + \
+ ["%s/cache/debconf/config.dat" % var_path,
"%s/cache/debconf/templates.dat" % var_path,
'/etc/passwd', '/etc/group',
'%s/apt/apt.conf' % etc_path,
diff --git a/src/lib/Client/Tools/Portage.py b/src/lib/Client/Tools/Portage.py
index dad9c4f3a..765e981fe 100644
--- a/src/lib/Client/Tools/Portage.py
+++ b/src/lib/Client/Tools/Portage.py
@@ -9,7 +9,6 @@ class Portage(Bcfg2.Client.Tools.PkgTool):
the rest from Toolset.Toolset."""
name = 'Portage'
__execs__ = ['/usr/bin/emerge', '/usr/bin/equery']
- __important__ = ['/etc/make.conf']
__handles__ = [('Package', 'ebuild')]
__req__ = {'Package': ['name', 'version']}
pkgtype = 'ebuild'
@@ -18,6 +17,7 @@ class Portage(Bcfg2.Client.Tools.PkgTool):
def __init__(self, logger, cfg, setup):
Bcfg2.Client.Tools.PkgTool.__init__(self, logger, cfg, setup)
+ self.__important__ = self.__important__ + ['/etc/make.conf']
self.cfg = cfg
self.installed = {}
self.RefreshPackages()
diff --git a/src/lib/Client/Tools/YUMng.py b/src/lib/Client/Tools/YUMng.py
index de5b221c1..a203b6961 100644
--- a/src/lib/Client/Tools/YUMng.py
+++ b/src/lib/Client/Tools/YUMng.py
@@ -75,7 +75,8 @@ class YUMng(Bcfg2.Client.Tools.RPMng.RPMng):
def __init__(self, logger, setup, config):
Bcfg2.Client.Tools.RPMng.RPMng.__init__(self, logger, setup, config)
- self.__important__ = [entry.get('name') for struct in config \
+ self.__important__ = self.__important__ + \
+ [entry.get('name') for struct in config \
for entry in struct \
if entry.tag in ['Path', 'ConfigFile'] and \
(entry.get('name').startswith('/etc/yum.d') \
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py
index 8ab815022..59f66612d 100644
--- a/src/lib/Client/Tools/__init__.py
+++ b/src/lib/Client/Tools/__init__.py
@@ -102,6 +102,9 @@ class Tool:
__important__ = []
def __init__(self, logger, setup, config):
+ self.__important__ = [entry.get('name') for struct in config for entry in struct \
+ if entry.tag == 'Path' and \
+ entry.get('important') in ['true', 'True']]
self.setup = setup
self.logger = logger
if not hasattr(self, '__ireq__'):