Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix compatibility with Hosted Chef #23

Merged
merged 1 commit into from

3 participants

@cgriego

Fixes #19

@travisbot

This pull request fails (merged 69fce6ff into ec64055).

@travisbot

This pull request fails (merged cb786b9 into ec64055).

@cgriego

FYI those specs were failing before I made any changes.

@danryan
Owner

@cgriego Thank you so so much for this patch. You rock! This will help a lot of people.

I haven't looked into the failing specs but they pass locally for me.. hmm. Another issue for another time.

@danryan danryan merged commit 16cfb1d into from
@cgriego

@danryan Thanks for the release. As for the failing specs, I think it's a newer version of Webmock that causes the failure. A bundle update on your workstation should cause the error to show up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 23, 2012
  1. @cgriego
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 5 deletions.
  1. +1 −1  lib/spice.rb
  2. +5 −4 lib/spice/request.rb
View
2  lib/spice.rb
@@ -25,7 +25,7 @@ def respond_to?(method, include_private=false)
end # def respond_to?
def mock
- Spice.server_url = 'http://localhost:4000'
+ Spice.server_url = 'http://localhost:4000/organizations/spice'
Spice.client_name = "testclient"
Spice.client_key = Spice.read_key_file(File.expand_path("../../spec/fixtures/client.pem", __FILE__))
Spice.chef_version = "0.10.10"
View
9 lib/spice/request.rb
@@ -46,12 +46,13 @@ def request(method, path, params, options)
json_params = params ? MultiJson.dump(params) : ""
uri = server_url
uri = URI(uri) unless uri.respond_to?(:host)
- uri += path
-
- headers = signature_headers(method.to_s.upcase.to_sym, uri.path, json_params)
+ full_path = uri.path + URI(path).path
+ full_path_and_params = uri.path + path
+
+ headers = signature_headers(method.to_s.upcase.to_sym, full_path, json_params)
# puts headers.inspect
# puts client_key.inspect
- response = connection.run_request(method.to_sym, path, nil, headers) do |request|
+ response = connection.run_request(method.to_sym, full_path_and_params, nil, headers) do |request|
request.options[:raw] = true if options[:raw]
# puts request.inspect
Something went wrong with that request. Please try again.