diff --git a/management/univention-management-console/conffiles/setup_saml_sp.py b/management/univention-management-console/conffiles/setup_saml_sp.py index e7b17cd999..d20a88e355 100644 --- a/management/univention-management-console/conffiles/setup_saml_sp.py +++ b/management/univention-management-console/conffiles/setup_saml_sp.py @@ -33,7 +33,7 @@ import os from glob import glob -from subprocess import call +from subprocess import call, Popen from time import sleep from urlparse import urlparse from defusedxml import ElementTree @@ -86,18 +86,20 @@ def download_idp_metadata(metadata): filename = '/usr/share/univention-management-console/saml/idp/%s.xml' % (idp,) for i in range(0, 60): print 'Try to download idp metadata (%s/60)' % (i + 1) - rc = call([ + p = Popen([ '/usr/bin/curl', '--fail', '--cacert', '/etc/univention/ssl/ucsCA/CAcert.pem', '-o', filename, metadata, - ]) - if rc and os.path.exists(filename): + ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) + stdout, stderr = p.communicate() + if p.returncode and os.path.exists(filename): os.remove(filename) - if rc == 0: + if p.returncode == 0: return True sleep(1) + print stdout return False