diff --git a/40univention-google-apps.inst b/40univention-google-apps.inst index 9ebe81f..fecec8f 100755 --- a/40univention-google-apps.inst +++ b/40univention-google-apps.inst @@ -228,16 +228,7 @@ if ! udm mail/domain list "$@" | grep -q "name: $domainname" ; then fi if joinscript_check_version_in_range_executed 1 1; then - python -c "from univention.googleapps.auth import GappsAuth, NoCredentials, CredentialsStorageError -try: - domain = GappsAuth.get_domain() - GappsAuth.update_saml_configuration(domain) -except NoCredentials as exc: - print 'No current connection configured for Google Apps. The saml configuration will not be changed' - exit(0) -except CredentialsStorageError as exc: - print 'An error prevented the saml configuration to get updated: %s' % exc - exit(1)" || die + /usr/share/univention-google-apps/update_saml_configuration || die fi stop_udm_cli_server diff --git a/debian/univention-google-apps.install b/debian/univention-google-apps.install index 17e952d..39f067d 100644 --- a/debian/univention-google-apps.install +++ b/debian/univention-google-apps.install @@ -8,5 +8,6 @@ google-apps.schema usr/share/univention-google-apps/ google-apps-for-work.php usr/share/univention-google-apps/ print_google_users_and_groups usr/share/univention-google-apps/ convert_credentials_file usr/share/univention-google-apps/ +update_saml_configuration usr/share/univention-google-apps/ umc/icons/googleapps.png var/www google_primary_address.py usr/share/pyshared/univention/admin/hooks.d/ diff --git a/update_saml_configuration b/update_saml_configuration new file mode 100644 index 0000000..680f635 --- /dev/null +++ b/update_saml_configuration @@ -0,0 +1,18 @@ +import sys +from univention.googleapps.auth import GappsAuth, NoCredentials, CredentialsStorageError + + +def update_saml_configuration(): + try: + domain = GappsAuth.get_domain() + GappsAuth.update_saml_configuration(domain) + except NoCredentials as exc: + print('No current connection configured for Google Apps. The saml configuration will not be changed') + sys.exit(0) + except CredentialsStorageError as exc: + print('An error prevented the saml configuration to get updated: {}'.format(exc)) + sys.exit(1) + + +if __name__ == "__main__": + update_saml_configuration()