Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gridtk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
software
gridtk
Commits
5c26d3a3
Commit
5c26d3a3
authored
11 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Removed warning on command line when executed outside Idiap.
parent
eac5be4c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gridtk/setshell.py
+12
-11
12 additions, 11 deletions
gridtk/setshell.py
with
12 additions
and
11 deletions
gridtk/setshell.py
+
12
−
11
View file @
5c26d3a3
...
...
@@ -19,17 +19,18 @@ def environ(context):
# It seems that we are in a hostile environment
# try to source the Idiap-wide shell
idiap_source
=
"
/idiap/resource/software/initfiles/shrc
"
logger
.
debug
(
"
Sourcing:
'
%s
'"
%
idiap_source
)
try
:
command
=
[
'
bash
'
,
'
-c
'
,
'
source %s && env
'
%
idiap_source
]
pi
=
subprocess
.
Popen
(
command
,
stdout
=
subprocess
.
PIPE
)
# overwrite the default environment
for
line
in
pi
.
stdout
:
(
key
,
_
,
value
)
=
line
.
partition
(
"
=
"
)
os
.
environ
[
key
.
strip
()]
=
value
.
strip
()
except
OSError
as
e
:
# occurs when the file is not executable or not found
pass
if
os
.
path
.
exists
(
idiap_source
):
logger
.
debug
(
"
Sourcing:
'
%s
'"
%
idiap_source
)
try
:
command
=
[
'
bash
'
,
'
-c
'
,
'
source %s && env
'
%
idiap_source
]
pi
=
subprocess
.
Popen
(
command
,
stdout
=
subprocess
.
PIPE
)
# overwrite the default environment
for
line
in
pi
.
stdout
:
(
key
,
_
,
value
)
=
line
.
partition
(
"
=
"
)
os
.
environ
[
key
.
strip
()]
=
value
.
strip
()
except
OSError
as
e
:
# occurs when the file is not executable or not found
pass
# in case the BASEDIRSETSHELL environment variable is not set,
# we are not at Idiap,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment