Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'services-r11'
Browse files Browse the repository at this point in the history
- bump vcap/services
- bump vcap_common gem version to 1.0.12

Conflicts:
	cloud_controller/Gemfile.lock
	cloud_controller/vendor/cache/vcap_common-1.0.11.gem
	common/vcap_common.gemspec

Change-Id: I09534faafb367a6cd2046c7fa4e15700366019e4
  • Loading branch information
kushmerick committed May 18, 2012
2 parents 85e1801 + 6528fd7 commit cbeb8a1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
@@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
vcap_common (1.0.11) vcap_common (1.0.12)
eventmachine (~> 0.12.11.cloudfoundry.3) eventmachine (~> 0.12.11.cloudfoundry.3)
nats (~> 0.4.22.beta.8) nats (~> 0.4.22.beta.8)
posix-spawn (~> 0.3.6) posix-spawn (~> 0.3.6)
Expand All @@ -20,8 +20,8 @@ GEM
eventmachine (>= 0.12.9) eventmachine (>= 0.12.9)
escape_utils (0.2.4) escape_utils (0.2.4)
eventmachine (0.12.11.cloudfoundry.3) eventmachine (0.12.11.cloudfoundry.3)
json_pure (1.6.5) json_pure (1.6.6)
nats (0.4.22.beta.8) nats (0.4.22)
daemons (>= 1.1.4) daemons (>= 1.1.4)
eventmachine (>= 0.12.10) eventmachine (>= 0.12.10)
json_pure (>= 1.6.1) json_pure (>= 1.6.1)
Expand Down
11 changes: 8 additions & 3 deletions lib/services/api/clients/service_gateway_client.rb
Expand Up @@ -103,11 +103,16 @@ def delete_snapshot(args)
Job.decode(resp) Job.decode(resp)
end end


def serialized_url(args) def create_serialized_url(args)
resp = perform_request(:get, "/gateway/v1/configurations/#{args[:service_id]}/serialized/url") resp = perform_request(:post, "/gateway/v1/configurations/#{args[:service_id]}/serialized/url/snapshots/#{args[:snapshot_id]}")
Job.decode(resp) Job.decode(resp)
end end


def serialized_url(args)
resp = perform_request(:get, "/gateway/v1/configurations/#{args[:service_id]}/serialized/url/snapshots/#{args[:snapshot_id]}")
SerializedURL.decode(resp)
end

def import_from_url(args) def import_from_url(args)
resp = perform_request(:put, "/gateway/v1/configurations/#{args[:service_id]}/serialized/url", args[:msg]) resp = perform_request(:put, "/gateway/v1/configurations/#{args[:service_id]}/serialized/url", args[:msg])
Job.decode(resp) Job.decode(resp)
Expand Down Expand Up @@ -167,10 +172,10 @@ def perform_request(http_method, path, msg=VCAP::Services::Api::EMPTY_REQUEST)
begin begin
# try to decode the response # try to decode the response
err = ServiceErrorResponse.decode(body) err = ServiceErrorResponse.decode(body)
raise ErrorResponse.new(code, err)
rescue => e rescue => e
raise UnexpectedResponse, "Can't decode gateway response. status code:#{code}, response body:#{body}" raise UnexpectedResponse, "Can't decode gateway response. status code:#{code}, response body:#{body}"
end end
raise ErrorResponse.new(code, err)
end end
end end
end end
Expand Down
2 changes: 1 addition & 1 deletion lib/vcap/component.rb
Expand Up @@ -45,7 +45,7 @@ def call(env)
class Component class Component


# We will suppress these from normal varz reporting by default. # We will suppress these from normal varz reporting by default.
CONFIG_SUPPRESS = Set.new([:mbus, :service_mbus, :keys, :database_environment, :mysql, :password]) CONFIG_SUPPRESS = Set.new([:mbus, :service_mbus, :keys, :database_environment, :password, :pass])


class << self class << self


Expand Down
16 changes: 9 additions & 7 deletions spec/functional/component_spec.rb
Expand Up @@ -65,8 +65,8 @@
options[:config] = { options[:config] = {
:mbus => 'nats://user:pass@localhost:4223', :mbus => 'nats://user:pass@localhost:4223',
:keys => 'sekret!keys', :keys => 'sekret!keys',
:mysql => { :user => 'derek', :password => 'sekret!' },
:password => 'crazy', :password => 'crazy',
:pass => 'crazy',
:database_environment => { :stuff => 'should not see' } :database_environment => { :stuff => 'should not see' }
} }
VCAP::Component.register(options) VCAP::Component.register(options)
Expand All @@ -81,10 +81,10 @@
options[:config] = { options[:config] = {
:mbus => 'nats://user:pass@localhost:4223', :mbus => 'nats://user:pass@localhost:4223',
:keys => 'sekret!keys', :keys => 'sekret!keys',
:mysql => { :user => 'derek', :password => 'sekret!' },
:password => 'crazy', :password => 'crazy',
:pass => 'crazy',
:database_environment => { :stuff => 'should not see' }, :database_environment => { :stuff => 'should not see' },
:this_is_ok => { :password => 'sekret!', :mysql => 'sekret!', :test => 'ok'} :this_is_ok => { :password => 'sekret!', :pass => 'sekret!', :test => 'ok'}
} }
VCAP::Component.register(options) VCAP::Component.register(options)
done done
Expand All @@ -98,20 +98,22 @@
options[:config] = { options[:config] = {
:mbus => 'nats://user:pass@localhost:4223', :mbus => 'nats://user:pass@localhost:4223',
:keys => 'sekret!keys', :keys => 'sekret!keys',
:mysql => { :user => 'derek', :password => 'sekret!' }, :mysql => { :user => 'derek', :password => 'sekret!', :pass => 'sekret!' },
:password => 'crazy', :password => 'crazy',
:pass => 'crazy',
:database_environment => { :stuff => 'should not see' }, :database_environment => { :stuff => 'should not see' },
:this_is_ok => { :password => 'sekret!', :mysql => 'sekret!', :test => 'ok'} :this_is_ok => { :password => 'sekret!', :pass => 'sekret!', :mysql => 'sekret!', :test => 'ok'}
} }
VCAP::Component.register(options) VCAP::Component.register(options)


options.should include(:config => { options.should include(:config => {
:mbus => 'nats://user:pass@localhost:4223', :mbus => 'nats://user:pass@localhost:4223',
:keys => 'sekret!keys', :keys => 'sekret!keys',
:mysql => { :user => 'derek', :password => 'sekret!' }, :mysql => { :user => 'derek', :password => 'sekret!', :pass => 'sekret!' },
:password => 'crazy', :password => 'crazy',
:pass => 'crazy',
:database_environment => { :stuff => 'should not see' }, :database_environment => { :stuff => 'should not see' },
:this_is_ok => { :password => 'sekret!', :mysql => 'sekret!', :test => 'ok'} :this_is_ok => { :password => 'sekret!', :pass => 'sekret!', :mysql => 'sekret!', :test => 'ok'}
}) })
done done
end end
Expand Down
4 changes: 3 additions & 1 deletion spec/unit/service_gateway_client_spec.rb
Expand Up @@ -65,8 +65,9 @@ class ServiceGatewayClient
{:code => 40400, :description=> "not found"}.to_json, {:code => 40400, :description=> "not found"}.to_json,
{:code => 50300, :description=> "internal"}.to_json, {:code => 50300, :description=> "internal"}.to_json,
{:code => 50100, :description=> "not done yet"}.to_json, {:code => 50100, :description=> "not done yet"}.to_json,
{:bad_response => "foo"}.to_json,
) )
resp.should_receive(:code).and_return(404, 503, 500) resp.should_receive(:code).and_return(404, 503, 500, 500)
resp.should_receive(:start).any_number_of_times.and_return resp resp.should_receive(:start).any_number_of_times.and_return resp


http_method = :get http_method = :get
Expand All @@ -75,6 +76,7 @@ class ServiceGatewayClient


expect {client.perform_request(http_method, path)}.should raise_error(VCAP::Services::Api::ServiceGatewayClient::NotFoundResponse) expect {client.perform_request(http_method, path)}.should raise_error(VCAP::Services::Api::ServiceGatewayClient::NotFoundResponse)
expect {client.perform_request(http_method, path)}.should raise_error(VCAP::Services::Api::ServiceGatewayClient::GatewayInternalResponse) expect {client.perform_request(http_method, path)}.should raise_error(VCAP::Services::Api::ServiceGatewayClient::GatewayInternalResponse)
expect {client.perform_request(http_method, path)}.should raise_error(VCAP::Services::Api::ServiceGatewayClient::ErrorResponse, /not done yet/)
expect {client.perform_request(http_method, path)}.should raise_error(VCAP::Services::Api::ServiceGatewayClient::UnexpectedResponse) expect {client.perform_request(http_method, path)}.should raise_error(VCAP::Services::Api::ServiceGatewayClient::UnexpectedResponse)
end end
end end
Expand Down
2 changes: 1 addition & 1 deletion vcap_common.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s| spec = Gem::Specification.new do |s|
s.name = 'vcap_common' s.name = 'vcap_common'
s.version = '1.0.11' s.version = '1.0.12'
s.date = '2011-02-09' s.date = '2011-02-09'
s.summary = 'vcap common' s.summary = 'vcap common'
s.homepage = "http://github.com/vmware-ac/core" s.homepage = "http://github.com/vmware-ac/core"
Expand Down

0 comments on commit cbeb8a1

Please sign in to comment.