Skip to content
Snippets Groups Projects
Commit da06b04e authored by Damian Alvarez's avatar Damian Alvarez
Browse files

hook update: Let the hook work inside the apptainer container even if

jutil is missing
parent bef4408f
Branches
Tags
No related merge requests found
import os import os
import pwd
import re import re
import subprocess import subprocess
...@@ -140,11 +141,15 @@ def get_user_info(): ...@@ -140,11 +141,15 @@ def get_user_info():
if name and email: if name and email:
return [name, email] return [name, email]
else: else:
if install_path().lower().startswith('/p/software'):
print_warning( print_warning(
f"\n'jutil' is not present and 'SITE_CONTACT_NAME' or 'SITE_CONTACT_EMAIL' are not defined\n" f"\n'jutil' is not present and 'SITE_CONTACT_NAME' or 'SITE_CONTACT_EMAIL' are not defined\n"
"Please defined both in your environment and try again\n" "Please defined both in your environment and try again\n"
) )
exit(1) exit(1)
# Assume user installations, contact data is not critical
else:
return [pwd.getpwuid(os.getuid())[4], '???']
else: else:
return ['CI user', 'ci_user@fz-juelich.de'] return ['CI user', 'ci_user@fz-juelich.de']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment