diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-11-23 23:44:47 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-11-23 23:44:47 +0000 |
commit | ae2fb0bbae1a4f70a4031e96ea267c237f0a5ed3 (patch) | |
tree | 11c15652b9a287601f9564761eebd28b3db5dca1 /src/lib/Client/Frame.py | |
parent | 21a85e34d327b27b243ae069aa1fffff382832ae (diff) | |
download | bcfg2-ae2fb0bbae1a4f70a4031e96ea267c237f0a5ed3.tar.gz bcfg2-ae2fb0bbae1a4f70a4031e96ea267c237f0a5ed3.tar.bz2 bcfg2-ae2fb0bbae1a4f70a4031e96ea267c237f0a5ed3.zip |
Make dryrun output conditional on required operations (Resolves Ticket #287)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2535 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Frame.py')
-rw-r--r-- | src/lib/Client/Frame.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py index 3ec2cb25a..2380ed4a1 100644 --- a/src/lib/Client/Frame.py +++ b/src/lib/Client/Frame.py @@ -92,12 +92,15 @@ class Frame: self.removal = [entry for entry in self.extra if entry.tag == 'Package'] if self.setup['dryrun']: - self.logger.info("In dryrun mode: suppressing entry installation for:") - self.logger.info(["%s:%s" % (entry.tag, entry.get('name')) for entry \ - in self.states if not self.states[entry]]) - self.logger.info("In dryrun mode: suppressing entry removal for:") - self.logger.info(["%s:%s" % (entry.tag, entry.get('name')) for entry \ - in self.removal]) + updated = [entry for entry in self.states if not self.states[entry]] + if updated: + self.logger.info("In dryrun mode: suppressing entry installation for:") + self.logger.info(["%s:%s" % (entry.tag, entry.get('name')) for entry \ + in updated]) + if self.removal: + self.logger.info("In dryrun mode: suppressing entry removal for:") + self.logger.info(["%s:%s" % (entry.tag, entry.get('name')) for entry \ + in self.removal]) self.removal = [] return elif self.setup['interactive']: |