From: nlebreto Date: Thu, 6 Feb 2014 14:33:54 +0000 (+0100) Subject: r1.7 adding error message for authentication problem X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=f8b8f02323bf0c88852dec05f3c2b21ded587335 r1.7 adding error message for authentication problem --- diff --git a/sfa/bonfire/bonfire.py b/sfa/bonfire/bonfire.py index 3d34f0cd..cdaf089e 100644 --- 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")' +# 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"])) + 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