summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-04-30 19:48:40 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-04-30 14:49:19 -0500
commit780f03b01a48daccceb287de61f2ff89e6c5056c (patch)
treeb0400946d4c5b162550b6a718a5d98a507dedb09 /src
parent09fcf23f499c3743f2e5634510cc9d2d8b9949e9 (diff)
downloadbcfg2-780f03b01a48daccceb287de61f2ff89e6c5056c.tar.gz
bcfg2-780f03b01a48daccceb287de61f2ff89e6c5056c.tar.bz2
bcfg2-780f03b01a48daccceb287de61f2ff89e6c5056c.zip
YUMng: Add support for Path type='ignore' entries
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5851 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Tools/RPMng.py19
-rw-r--r--src/lib/Client/Tools/YUMng.py4
2 files changed, 21 insertions, 2 deletions
diff --git a/src/lib/Client/Tools/RPMng.py b/src/lib/Client/Tools/RPMng.py
index b8f09ed3e..06792ef13 100644
--- a/src/lib/Client/Tools/RPMng.py
+++ b/src/lib/Client/Tools/RPMng.py
@@ -42,6 +42,10 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
def __init__(self, logger, setup, config):
Bcfg2.Client.Tools.PkgTool.__init__(self, logger, setup, config)
+ # create a global ignore list used when ignoring particular
+ # files during package verification
+ self.ignores = [entry.get('name') for struct in config for entry in struct \
+ if entry.get('type') == 'ignore']
self.instance_status = {}
self.extra_instances = []
self.modlists = {}
@@ -364,7 +368,9 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
# Check the rpm verify file results against the modlist
# and entry and per Instance Ignores.
- ignores = [ig.get('name') for ig in entry.findall('Ignore')] + [ig.get('name') for ig in inst.findall('Ignore')]
+ ignores = [ig.get('name') for ig in entry.findall('Ignore')] + \
+ [ig.get('name') for ig in inst.findall('Ignore')] + \
+ self.ignores
for file_result in result.get('files', []):
if file_result[-1] not in modlist + ignores:
instance_fail = True
@@ -830,6 +836,10 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
self.logger.error("Incomplete information for entry %s:%s; cannot verify" \
% (entry.tag, entry.get('name')))
return False
+ elif entry.tag == 'Path' and entry.get('type') == 'ignore':
+ # ignored Paths are only relevant during failed package
+ # verification
+ pass
else:
if [attr for attr in self.__req__[entry.tag] if attr not in entry.attrib]:
self.logger.error("Incomplete information for entry %s:%s; cannot verify" \
@@ -1008,3 +1018,10 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
init_ts.closeDB()
del init_ts
return keyids
+
+ def VerifyPath(self, entry, _):
+ """
+ We don't do anything here since all
+ Paths are processed in __init__
+ """
+ return True
diff --git a/src/lib/Client/Tools/YUMng.py b/src/lib/Client/Tools/YUMng.py
index 494c9f896..9faeb3328 100644
--- a/src/lib/Client/Tools/YUMng.py
+++ b/src/lib/Client/Tools/YUMng.py
@@ -51,7 +51,9 @@ class YUMng(Bcfg2.Client.Tools.RPMng.RPMng):
name = 'YUMng'
__execs__ = ['/usr/bin/yum', '/var/lib/rpm']
- __handles__ = [('Package', 'yum'), ('Package', 'rpm')]
+ __handles__ = [('Package', 'yum'),
+ ('Package', 'rpm'),
+ ('Path', 'ignore')]
__req__ = {'Package': ['name', 'version']}
__ireq__ = {'Package': ['name']}