deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 3/6] CIMI tests: do not send any auth header if no user is set
Date Tue, 04 Dec 2012 08:42:31 GMT
From: David Lutterkort <lutter@redhat.com>

---
 tests/cimi/test_helper.rb |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb
index 009bac6..0e102c4 100644
--- a/tests/cimi/test_helper.rb
+++ b/tests/cimi/test_helper.rb
@@ -50,6 +50,14 @@ module CIMI
         "Basic #{Base64.encode64("#{u}:#{p}")}"
       end
 
+      def auth_header
+        if @cimi["user"]
+          { "Authorization" => basic_auth }
+        else
+          {}
+        end
+      end
+
       def preferred
         @cimi["preferred"] || {}
       end
@@ -164,9 +172,7 @@ module CIMI::Test::Methods
     end
 
     def headers(params)
-      headers = {
-        'Authorization' => api.basic_auth
-      }
+      headers = api.auth_header
       if params[:accept]
         headers["Accept"] = "application/#{params.delete(:accept)}"
       else
-- 
1.7.7.6


Mime
View raw message