diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-02-01 16:49:22 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-02-01 16:49:22 +0000 |
commit | 413d2050d50aa4c50ec7f9432e040c58edf58b04 (patch) | |
tree | 617204895e57e517a9102e21c32a99425bf34698 /src/lib/Client | |
parent | a3584a5fab31bb71fa621f5df6eb1d14a02a1200 (diff) | |
download | bcfg2-413d2050d50aa4c50ec7f9432e040c58edf58b04.tar.gz bcfg2-413d2050d50aa4c50ec7f9432e040c58edf58b04.tar.bz2 bcfg2-413d2050d50aa4c50ec7f9432e040c58edf58b04.zip |
implement --r=all|package
2005/01/31 10:46:36-06:00 anl.gov!desai
add more verbose display
2005/01/31 10:45:59-06:00 anl.gov!desai
fix bug from templeton
(Logical change 1.198)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@845 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r-- | src/lib/Client/Debian.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/lib/Client/Debian.py b/src/lib/Client/Debian.py index 1705be7d5..823848824 100644 --- a/src/lib/Client/Debian.py +++ b/src/lib/Client/Debian.py @@ -129,18 +129,28 @@ class Debian(Toolset): allsrv = [] [allsrv.append(fname[14:]) for fname in glob("/etc/rc[12345].d/S*") if fname[14:] not in allsrv] csrv = self.cfg.findall(".//Service") - [allsrv.remove(svc.get('name')) for svc in csrv if svc.get('status') == 'on'] + [allsrv.remove(svc.get('name')) for svc in csrv if svc.get('status') == 'on' and svc.get('name') in allsrv] self.extra_services = allsrv + + def HandleExtra(self): + '''Deal with extra configuration detected''' + if self.setup['remove'] in ['all', 'packages']: + self.CondPrint('verbose', "Removing packages:", self.pkgwork['remove']) + system("apt-get remove %s" % " ".join(self.pkgwork['remove'])) + else: + self.CondPrint('verbose', "Need to remove packages:", self.pkgwork['remove']) + self.CondPrint('verbose', "Need to remove services:", self.extra_services) def Install(self): '''Correct detected misconfigurations''' self.CondPrint("verbose", "Installing needed configuration changes") cmd = '''apt-get --reinstall -q=2 --force-yes -y install %s''' - print "Need to remove:", self.pkgwork['remove'], self.extra_services + self.HandleExtra() self.setup['quick'] = True - - self.CondPrint('dryrun', "Packages to update: %s" % (" ".join([pkg.get('name') for pkg in self.pkgwork['update']]))) - self.CondPrint('dryrun', "Packages to add: %s" % (" ".join([pkg.get('name') for pkg in self.pkgwork['add']]))) + self.CondPrint('dryrun', "Packages to update: %s" % + (" ".join([pkg.get('name') for pkg in self.pkgwork['update']]))) + self.CondPrint('dryrun', "Packages to add: %s" % + (" ".join([pkg.get('name') for pkg in self.pkgwork['add']]))) self.CondPrint('dryrun', "Packages to remove %s" % (" ".join(self.pkgwork['remove']))) for entry in [entry for entry in self.states if (not self.states[entry] and (entry.tag != 'Package'))]: |