[SCM] ci-tooling packaging branch, master, updated. b83c1b652a97060bd6b3ed170a8d8360b563bfed

Harald Sitter apachelogger-guest at moszumanska.debian.org
Sun Jan 4 22:48:03 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=b83c1b6

The following commit has been merged in the master branch:
commit b83c1b652a97060bd6b3ed170a8d8360b563bfed
Author: Harald Sitter <sitter at kde.org>
Date:   Sun Jan 4 23:47:54 2015 +0100

    lp: fix token usage
    
    - raise errors if http fails
    - use correct uri.path/query uri version as appropriate, the api is a bit
      inconsistent unfortunately
---
 lib/lp.rb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/lp.rb b/lib/lp.rb
index 84f8a4c..b8b066a 100644
--- a/lib/lp.rb
+++ b/lib/lp.rb
@@ -51,7 +51,11 @@ module Launchpad
 
     def self.get(uri)
         if @token
-            return @token.get(uri.path, "Cache-Control" => "max-age=0")
+            # Token internally URIfies again without checking if it already has
+            # a URI, so simply give it a string...
+            response = @token.get(uri.to_s)
+            raise Net::HTTPRetriableError.new(response.body, response) unless response.kind_of? Net::HTTPSuccess
+            return response.body
         end
 
         # Set cache control.
@@ -69,7 +73,9 @@ module Launchpad
 
     def self.post(uri)
         # Posting always requires a token.
-        return @token.post(uri.path)
+        response = @token.post(uri.path, uri.query)
+        raise raise Net::HTTPRetriableError.new(response.body, response) unless response.kind_of? Net::HTTPSuccess
+        return response.body
     end
 
     # Condom for launchpad.

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list