From 31b12d4b59c8aebd1d7ec410383e8cf202efedb5 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 22 Aug 2006 19:32:20 +0000 Subject: Add -k (kevlar) option, and move objectionable debian behavion in here. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2088 ce84e21b-d406-0410-9b95-82705330c041 --- man/bcfg2.1 | 5 +++++ src/lib/Client/Debian.py | 9 ++++----- src/sbin/bcfg2 | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/man/bcfg2.1 b/man/bcfg2.1 index 127e037a4..4af67efeb 100644 --- a/man/bcfg2.1 +++ b/man/bcfg2.1 @@ -57,6 +57,11 @@ Cause bcfg2 to remove extra configuration elements it detects. Mode is one of al .RS Assert a profile for the current client. .RE +.B "\-k" +.RS +Run in bulletproof mode. This currently only effect behavior in the +debian toolset; it calls apt-get update and clean and dpkg --configure --pending. +.RE .SH "SEE ALSO" .BR bcfg2-server(8), .BR bcfg2-info(8) diff --git a/src/lib/Client/Debian.py b/src/lib/Client/Debian.py index 2ad28f08f..4c13443f0 100644 --- a/src/lib/Client/Debian.py +++ b/src/lib/Client/Debian.py @@ -23,11 +23,10 @@ class ToolsetImpl(Bcfg2.Client.Toolset.Toolset): null = open('/dev/null', 'w+') os.dup2(null.fileno(), sys.__stdin__.fileno()) if not self.setup['dryrun']: - self.saferun("dpkg --force-confold --configure -a") - if not self.setup['build']: - self.saferun("/usr/sbin/dpkg-reconfigure -f noninteractive debconf < /dev/null") - self.saferun("apt-get clean") - self.saferun("apt-get -q=2 -y update") + if self.setup['kevlar']: + self.saferun("dpkg --force-confold --configure --pending") + self.saferun("apt-get clean") + self.saferun("apt-get -q=2 -y update") self.installed = {} self.pkgwork = {'add':[], 'update':[], 'remove':[]} for pkg in [cpkg for cpkg in self.cfg.findall(".//Package") if not cpkg.attrib.has_key('type')]: diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2 index 299807b18..aa8b0b8a3 100755 --- a/src/sbin/bcfg2 +++ b/src/sbin/bcfg2 @@ -59,6 +59,8 @@ class Client: False, ('communication', 'password'), 'password', False), 'retries': (('-R', '', 'the number of times to retry network communication'), False, ('communication', 'retries'), '3', False), + 'kevlar': (('-k', False, "run in kevlar (bulletproof) mode"), + False, False, False, True), } self.setup = Bcfg2.Options.OptionParser('bcfg2', optinfo).parse() -- cgit v1.2.3-1-g7c22