git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1.7 adding error message for authentication problem
[sfa.git]
/
sfa
/
bonfire
/
bonfire.py
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