Add option to have ipautil.run() not raise an exception

There are times where a caller will want to determine the course of
action based on the returncode instead of relying on it != 0.

This also lets the caller get the contents of stdout and stderr.
This commit is contained in:
Rob Crittenden
2009-11-30 15:28:09 -05:00
parent 29aa8fb05d
commit 7c2c2d6130
6 changed files with 17 additions and 17 deletions

View File

@@ -100,7 +100,7 @@ class HTTPInstance(service.Service):
if selinux:
try:
# returns e.g. "httpd_can_network_connect --> off"
(stdout, stderr) = ipautil.run(["/usr/sbin/getsebool",
(stdout, stderr, returncode) = ipautil.run(["/usr/sbin/getsebool",
"httpd_can_network_connect"])
self.backup_state("httpd_can_network_connect", stdout.split()[2])
except: