[node-patches] Change in ovirt-node[master]: Don't litter the screen with output, so get a handle to /dev...

hadong0720 at gmail.com hadong0720 at gmail.com
Mon Jul 7 08:58:51 UTC 2014


hadong has uploaded a new change for review.

Change subject: Don't litter the screen with output, so get a handle to /dev/null
......................................................................

Don't litter the screen with output, so get a handle to /dev/null

Don't litter the screen with the "puppet agent --waitforcert 60 --test"
output, so get a handle to /dev/null
Change-Id: I5f28016086a31091e4819c162e4a911cf800aa81
Signed-off-by: hadong <hadong at redhat.com>
---
M src/ovirt/node/setup/puppet/puppet_page.py
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/27/29627/1

diff --git a/src/ovirt/node/setup/puppet/puppet_page.py b/src/ovirt/node/setup/puppet/puppet_page.py
index 787ce23..032c4f4 100644
--- a/src/ovirt/node/setup/puppet/puppet_page.py
+++ b/src/ovirt/node/setup/puppet/puppet_page.py
@@ -24,6 +24,7 @@
 from ovirt.node.utils import system, fs
 from ovirt.node.utils.fs import File
 import re
+import os
 
 """
 Configure Puppet
@@ -169,8 +170,12 @@
         fs.Config().persist("/etc/puppet/puppet.conf")
         try:
             system.service("puppet", "stop")
-            utils.process.check_call("puppet agent --waitforcert 60 --test",
-                                     shell=True)
+            with open(os.devnull, 'wb') as DEVNULL:
+                utils.process.check_call("puppet agent --waitforcert 60 \
+                                         --test",
+                                         stdout=DEVNULL,
+                                         stderr=DEVNULL,
+                                         shell=True)
             system.service("puppet", "start")
             fs.Config().persist("/var/lib/puppet")
         except:


-- 
To view, visit http://gerrit.ovirt.org/29627
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f28016086a31091e4819c162e4a911cf800aa81
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list