summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-03 14:03:39 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-03 14:03:39 -0400
commit21b4683ae7044a72b7b369a49c9baefcca542a5c (patch)
tree2a914e4c8913c556bd79ff9c7b989e02249e67f9 /src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
parent4b5ce3bd4a71dfcc26983dfdbd00923f1d5d0d6c (diff)
downloadbcfg2-21b4683ae7044a72b7b369a49c9baefcca542a5c.tar.gz
bcfg2-21b4683ae7044a72b7b369a49c9baefcca542a5c.tar.bz2
bcfg2-21b4683ae7044a72b7b369a49c9baefcca542a5c.zip
improved verbosity of bcfg2-yum-helper when bcfg2-server is run with -v
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Yum.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
index a1499e263..4ae730935 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
@@ -424,16 +424,12 @@ class YumCollection(Collection):
around that in long-running processes it to have a short-lived
helper. No, seriously -- check out the yum-updatesd code.
It's pure madness. """
- # it'd be nice if we could change this to be more verbose if
- # -v was given to bcfg2-server, but Collection objects don't
- # get the 'setup' variable, so we don't know how verbose
- # bcfg2-server is. It'd also be nice if we could tell yum to
- # log to syslog. So would a unicorn.
cmd = [self.helper, "-c", self.cfgfile]
- if self.debug_flag:
+ verbose = self.debug_flag or self.setup['verbose']
+ if verbose:
cmd.append("-v")
cmd.append(command)
- self.debug_log("Packages: running %s" % " ".join(cmd))
+ self.debug_log("Packages: running %s" % " ".join(cmd), flag=verbose)
try:
helper = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
except OSError:
@@ -451,9 +447,9 @@ class YumCollection(Collection):
if rv:
self.logger.error("Packages: error running bcfg2-yum-helper "
"(returned %d): %s" % (rv, stderr))
- elif self.debug_flag:
+ else:
self.debug_log("Packages: debug info from bcfg2-yum-helper: %s" %
- stderr)
+ stderr, flag=verbose)
try:
return json.loads(stdout)
except ValueError: