mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user