Skip to content

Commit

Permalink
Modified template such that Local jobs runs in
Browse files Browse the repository at this point in the history
login environment and not environment of the Ganga session
  • Loading branch information
egede committed Apr 24, 2024
1 parent a2465d0 commit 144d276
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ganga/GangaCore/Lib/Localhost/LocalHostExec.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,16 @@ gangadir = ###GANGADIR###
sys.path.insert(0, gangadir)
sys.path.insert(0,os.path.join(os.getcwd(),PYTHON_DIR))

runenv = os.environ.copy()
for key,value in environment.items():
runenv[key] = value
runenv = dict()
result = subprocess.run(["bash", "-lc", "printenv"], capture_output=True, encoding='utf-8')
for line in result.stdout.split('\n'):
varval = line.strip().split('=')
if len(varval) < 2:
pass
else:
content = ''.join(varval[1:])
if not str(content).startswith('() {'):
os.environ[varval[0]] = content

outfile=open('stdout','w')
errorfile=open('stderr','w')
Expand Down

0 comments on commit 144d276

Please sign in to comment.