diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-11-25 17:17:18 +0100 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-12-14 10:54:23 +0100 |
commit | 099cf98307d4b2f0ace5d5e28754f264808bf59d (patch) | |
tree | a2cfad681ef3e0adf47afdd0810e69d760fa07bf /install/oddjob | |
parent | 4cc206b0f82dd68d615f0aebba5b03acf127f53a (diff) | |
download | freeipa-099cf98307d4b2f0ace5d5e28754f264808bf59d.tar.gz freeipa-099cf98307d4b2f0ace5d5e28754f264808bf59d.tar.xz freeipa-099cf98307d4b2f0ace5d5e28754f264808bf59d.zip |
Refactor ipautil.run
The ipautil.run function now returns an object with returncode and
output are accessible as attributes.
The stdout and stderr of all commands are logged (unless skip_output is given).
The stdout/stderr contents must be explicitly requested with a keyword
argument, otherwise they are None.
This is because in Python 3, the output needs to be decoded, and that can
fail if it's not decodable (human-readable) text.
The raw (bytes) output is always available from the result object,
as is "leniently" decoded output suitable for logging.
All calls are changed to reflect this.
A use of Popen in cainstance is changed to ipautil.run.
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'install/oddjob')
-rwxr-xr-x | install/oddjob/com.redhat.idm.trust-fetch-domains | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/install/oddjob/com.redhat.idm.trust-fetch-domains b/install/oddjob/com.redhat.idm.trust-fetch-domains index 019545b93..ea82e086e 100755 --- a/install/oddjob/com.redhat.idm.trust-fetch-domains +++ b/install/oddjob/com.redhat.idm.trust-fetch-domains @@ -26,9 +26,8 @@ def retrieve_keytab(api, ccache_name, oneway_keytab_name, oneway_principal): if os.path.isfile(oneway_keytab_name): os.unlink(oneway_keytab_name) - (stdout, stderr, retcode) = ipautil.run(getkeytab_args, - env={'KRB5CCNAME': ccache_name, 'LANG': 'C'}, - raiseonerr=False) + ipautil.run(getkeytab_args, env={'KRB5CCNAME': ccache_name, 'LANG': 'C'}, + raiseonerr=False) # Make sure SSSD is able to read the keytab try: sssd = pwd.getpwnam('sssd') |