summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/APT.py
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-04-13 16:44:37 -0500
committerSol Jerome <solj@ices.utexas.edu>2010-04-13 16:45:34 -0500
commitf5d5fef2198da70b2d87c1e8ec8315441a475800 (patch)
tree0bbdc8c1e023aac17a0804b585f2e25f633c1f02 /src/lib/Client/Tools/APT.py
parentd61537b41f5781790554a3634aa51ef5ffe679d2 (diff)
downloadbcfg2-f5d5fef2198da70b2d87c1e8ec8315441a475800.tar.gz
bcfg2-f5d5fef2198da70b2d87c1e8ec8315441a475800.tar.bz2
bcfg2-f5d5fef2198da70b2d87c1e8ec8315441a475800.zip
APT: Add sources.list* to __important__ list
Frame: Fix bug in handling of __important__ entries This should allow people the easier option of configuring their APT sources in the /etc/sources.list.d dirctory instead of just relying on sources.list to be correct. This commit also fixes a bug where the client was relying on a 'ConfigFile' entry tag even in the case where a Path entry was present. Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
Diffstat (limited to 'src/lib/Client/Tools/APT.py')
-rw-r--r--src/lib/Client/Tools/APT.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index f44690e8a..082e51ef6 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -31,12 +31,6 @@ class APT(Bcfg2.Client.Tools.Tool):
the rest from Toolset.Toolset'''
name = 'APT'
__execs__ = [DEBSUMS, APTGET, DPKG]
- __important__ = ["%s/apt/sources.list" % etc_path,
- "%s/cache/debconf/config.dat" % var_path,
- "%s/cache/debconf/templates.dat" % var_path,
- '/etc/passwd', '/etc/group',
- '%s/apt/apt.conf' % etc_path,
- '%s/dpkg/dpkg.cfg' % etc_path]
__handles__ = [('Package', 'deb')]
__req__ = {'Package': ['name', 'version']}
pkgcmd = '%s ' % APTGET + \
@@ -47,9 +41,16 @@ class APT(Bcfg2.Client.Tools.Tool):
'--force-yes ' + \
'-y install %s'
- def __init__(self, logger, cfg, setup):
- Bcfg2.Client.Tools.Tool.__init__(self, logger, cfg, setup)
- self.cfg = cfg
+ def __init__(self, logger, setup, config):
+ Bcfg2.Client.Tools.Tool.__init__(self, logger, setup, config)
+ 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,
+ '%s/dpkg/dpkg.cfg' % etc_path] + \
+ [entry.get('name') for struct in config for entry in struct \
+ if entry.tag in ['Path', 'ConfigFile'] and \
+ entry.get('name').startswith('%s/apt/sources.list' % etc_path)]
os.environ["DEBIAN_FRONTEND"] = 'noninteractive'
self.actions = {}
if self.setup['kevlar'] and not self.setup['dryrun']: