summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2011-01-22 09:50:15 -0600
committerNarayan Desai <desai@mcs.anl.gov>2011-01-22 09:50:15 -0600
commit1e601ac56f7a91631274f26dfc3cef7a4be5b3bc (patch)
tree3d359032441e54a8f2e1a43569f67edc88ebb5f7 /src/lib/Client
parente00f3cb2172895bc5ae8a1fbfb618735e5452c45 (diff)
downloadbcfg2-1e601ac56f7a91631274f26dfc3cef7a4be5b3bc.tar.gz
bcfg2-1e601ac56f7a91631274f26dfc3cef7a4be5b3bc.tar.bz2
bcfg2-1e601ac56f7a91631274f26dfc3cef7a4be5b3bc.zip
APT: Enforce appearance of /usr/sbin and /sbin in PATH (Resolves Ticket #968)
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Tools/APT.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index 38e2938a0..cc445f961 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -40,6 +40,10 @@ class APT(Bcfg2.Client.Tools.Tool):
def __init__(self, logger, setup, config):
Bcfg2.Client.Tools.Tool.__init__(self, logger, setup, config)
+ path_entries = os.environ['PATH'].split(':')
+ for reqdir in ['/sbin', '/usr/sbin']:
+ if reqdir not in path_entries:
+ os.environ['PATH'] = os.environ['PATH'] + ':' + reqdir
self.pkgcmd = '%s ' % APTGET + \
'-o DPkg::Options::=--force-overwrite ' + \
'-o DPkg::Options::=--force-confold ' + \
@@ -47,7 +51,7 @@ class APT(Bcfg2.Client.Tools.Tool):
'--reinstall ' + \
'--force-yes '
if not self.setup['debug']:
- self.pkgcmd += '-q=2 '
+ self.pkgcmd += '-q=2 '
self.pkgcmd += '-y install %s'
self.__important__ = self.__important__ + \
["%s/cache/debconf/config.dat" % var_path,