git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e11a52d
)
r1.7 adding error message for authentication problem
author
nlebreto
<nicolas.lebreton@inria.fr>
Thu, 6 Feb 2014 14:33:54 +0000
(15:33 +0100)
committer
nlebreto
<nicolas.lebreton@inria.fr>
Thu, 6 Feb 2014 14:33:54 +0000
(15:33 +0100)
sfa/bonfire/bonfire.py
patch
|
blob
|
history
diff --git
a/sfa/bonfire/bonfire.py
b/sfa/bonfire/bonfire.py
index
3d34f0c
..
cdaf089
100644
(file)
--- a/
sfa/bonfire/bonfire.py
+++ b/
sfa/bonfire/bonfire.py
@@
-35,6
+35,9
@@
import time
# 8) attach slice to a user (did not work)
# python -c 'import bonfire; print bonfire.create_slice_attach_user("topdomain.dummy.alice")'
# 8) attach slice to a user (did not work)
# python -c 'import bonfire; print bonfire.create_slice_attach_user("topdomain.dummy.alice")'
+# 9) verify bonfire authentication
+# # python -c 'import bonfire; print bonfire.callcurl("https://api.bonfire-project.eu/")'
+
# ########################################################## #
# ########################################################## #
# ########################################################## #
# ########################################################## #
@@
-153,6
+156,8
@@
def rsa_user_bonfire(testbed, num_compute):
def callcurl(url):
h = bonfire_authenticate()
r = requests.get(url, verify=False, auth=(h["user"], h["user_pass"]))
def callcurl(url):
h = bonfire_authenticate()
r = requests.get(url, verify=False, auth=(h["user"], h["user_pass"]))
+ if r.status_code == 401:
+ return "error 401, you need to be register to the portal f4f"
if r.status_code == 200:
return r.text
if r.status_code == 200:
return r.text