From f8b8f02323bf0c88852dec05f3c2b21ded587335 Mon Sep 17 00:00:00 2001
From: nlebreto <nicolas.lebreton@inria.fr>
Date: Thu, 6 Feb 2014 15:33:54 +0100
Subject: [PATCH] r1.7 adding error message for authentication problem

---
 sfa/bonfire/bonfire.py | 5 +++++
 1 file changed, 5 insertions(+)

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
         
-- 
2.47.0