Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
esap-userprofile-python-client
Manage
Activity
Members
Labels
Plan
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
ESCAPE WP5
esap-userprofile-python-client
Commits
2ecaf593
Commit
2ecaf593
authored
3 years ago
by
Klaas Kliffen
Browse files
Options
Downloads
Patches
Plain Diff
Add environment variable reading for DLaaS notebook
parent
b6ed5881
No related branches found
No related tags found
1 merge request
!8
SDC-307 Cern dlaas notebook
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
shopping_client/shopping_client.py
+13
-6
13 additions, 6 deletions
shopping_client/shopping_client.py
with
13 additions
and
6 deletions
shopping_client/shopping_client.py
+
13
−
6
View file @
2ecaf593
import
request
s
import
getpas
s
import
json
import
urllib.parse
import
getpass
import
pandas
as
pd
from
typing
import
Union
,
Optional
from
typing
import
Optional
,
Union
from
warnings
import
warn
from
os
import
getenv
import
pandas
as
pd
import
requests
class
shopping_client
:
...
...
@@ -131,4 +132,10 @@ class shopping_client:
return
self
.
basket
def
_get_token
(
self
):
# Try to get token from Rucio OIDC file (when running in CERN DLaaS notebook)
token_fn
=
getenv
(
"
RUCIO_OIDC_FILE_NAME
"
)
if
token_fn
is
not
None
:
with
open
(
token_fn
)
as
token_file
:
self
.
token
=
token_file
.
readline
()
else
:
self
.
token
=
getpass
.
getpass
(
"
Enter your ESAP access token:
"
)
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