Skip to content

Commit

Permalink
Use new provision response format
Browse files Browse the repository at this point in the history
Change-Id: Ib1fa1fa3d1be93770463e648f0f8d538aafeca26
  • Loading branch information
Tang Rui committed Aug 5, 2012
1 parent adec879 commit 9295d12
Show file tree
Hide file tree
Showing 64 changed files with 169 additions and 122 deletions.
4 changes: 2 additions & 2 deletions atmos/Gemfile
Expand Up @@ -11,9 +11,9 @@ gem "sinatra"
gem "thin"
gem "xml-simple"

gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b7e3508eb9'
gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b0cc19d5'
gem 'vcap_logging', :require => ['vcap/logging'], :git => 'git://github.com/cloudfoundry/common.git', :ref => 'b96ec1192'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => '4db4cc92ce'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => 'b8a47d1b'
gem 'warden-client', :require => ['warden/client'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'
gem 'warden-protocol', :require => ['warden/protocol'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'

Expand Down
14 changes: 9 additions & 5 deletions atmos/Gemfile.lock
Expand Up @@ -15,20 +15,22 @@ GIT

GIT
remote: git://github.com/cloudfoundry/vcap-common.git
revision: b7e3508eb96b86162ca385f1f46a13ecfcce359d
ref: b7e3508eb9
revision: b0cc19d5520c9849600dbd8cf2883bff66d7643e
ref: b0cc19d5
specs:
vcap_common (1.0.14)
vcap_common (2.0.4)
eventmachine
httpclient
membrane (~> 0.0.2)
nats (~> 0.4.22.beta.8)
posix-spawn (~> 0.3.6)
thin (~> 1.3.1)
yajl-ruby (~> 0.8.3)

GIT
remote: git://github.com/cloudfoundry/vcap-services-base.git
revision: 4db4cc92ce5dc83d2cce95999508dbda51b34f0b
ref: 4db4cc92ce
revision: b8a47d1bc7d8901362db938a146107ccfb4f92e4
ref: b8a47d1b
specs:
vcap_services_base (0.1.12)
curb (~> 0.7.16)
Expand Down Expand Up @@ -128,10 +130,12 @@ GEM
eventmachine_httpserver (0.2.1)
fastercsv (1.5.5)
http_parser.rb (0.5.3)
httpclient (2.2.5)
json (1.4.6)
json_pure (1.7.3)
macaddr (1.6.1)
systemu (~> 2.5.0)
membrane (0.0.2)
multi_json (1.0.4)
nats (0.4.24)
daemons (>= 1.1.5)
Expand Down
9 changes: 1 addition & 8 deletions atmos/lib/atmos_service/provisioner.rb
Expand Up @@ -45,20 +45,13 @@ def provision_service(request, prov_handle=nil, &blk)
shared_secret = @atmos_helper.create_user(token, st_name)

svc = {
:data => {:subtenant_name => st_name, :subtenant_id => st_id, :host => @host},
:service_id => st_name,
:credentials => {:host => @host, :port => @port, :token => token,
:shared_secret => shared_secret, :subtenant_id => st_id}
}
# set 'configuration' instead of 'data' to keep local hash consistent
svc_local = {
:configuration => {"subtenant_name" => st_name, "subtenant_id" => st_id, "host" => @host},
:service_id => st_name,
:credentials => {"host" => @host, "port" => @port, "token" => token,
"shared_secret" => shared_secret, "subtenant_id" => st_id}
}
@logger.debug("Service provisioned: #{svc.inspect}")
@prov_svcs[svc[:service_id]] = svc_local
@prov_svcs[svc[:service_id]] = svc
blk.call(success(svc))
rescue => e
# roll back work
Expand Down
Binary file added atmos/vendor/cache/httpclient-2.2.5.gem
Binary file not shown.
Binary file added atmos/vendor/cache/membrane-0.0.2.gem
Binary file not shown.
4 changes: 2 additions & 2 deletions couchdb/Gemfile
Expand Up @@ -12,9 +12,9 @@ gem "sinatra"
gem "thin"
gem "couchrest"

gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b7e3508eb9'
gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b0cc19d5'
gem 'vcap_logging', :require => ['vcap/logging'], :git => 'git://github.com/cloudfoundry/common.git', :ref => 'b96ec1192'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => '4db4cc92ce'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => 'b8a47d1b'
gem 'warden-client', :require => ['warden/client'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'
gem 'warden-protocol', :require => ['warden/protocol'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'

Expand Down
14 changes: 9 additions & 5 deletions couchdb/Gemfile.lock
Expand Up @@ -15,20 +15,22 @@ GIT

GIT
remote: git://github.com/cloudfoundry/vcap-common.git
revision: b7e3508eb96b86162ca385f1f46a13ecfcce359d
ref: b7e3508eb9
revision: b0cc19d5520c9849600dbd8cf2883bff66d7643e
ref: b0cc19d5
specs:
vcap_common (1.0.14)
vcap_common (2.0.4)
eventmachine
httpclient
membrane (~> 0.0.2)
nats (~> 0.4.22.beta.8)
posix-spawn (~> 0.3.6)
thin (~> 1.3.1)
yajl-ruby (~> 0.8.3)

GIT
remote: git://github.com/cloudfoundry/vcap-services-base.git
revision: 4db4cc92ce5dc83d2cce95999508dbda51b34f0b
ref: 4db4cc92ce
revision: b8a47d1bc7d8901362db938a146107ccfb4f92e4
ref: b8a47d1b
specs:
vcap_services_base (0.1.12)
curb (~> 0.7.16)
Expand Down Expand Up @@ -132,10 +134,12 @@ GEM
eventmachine_httpserver (0.2.1)
fastercsv (1.5.5)
http_parser.rb (0.5.3)
httpclient (2.2.5)
json (1.4.6)
json_pure (1.7.3)
macaddr (1.6.1)
systemu (~> 2.5.0)
membrane (0.0.2)
mime-types (1.18)
multi_json (1.3.6)
nats (0.4.24)
Expand Down
Binary file added couchdb/vendor/cache/httpclient-2.2.5.gem
Binary file not shown.
Binary file added couchdb/vendor/cache/membrane-0.0.2.gem
Binary file not shown.
4 changes: 2 additions & 2 deletions echo/Gemfile
Expand Up @@ -11,9 +11,9 @@ gem "do_sqlite3"
gem "sinatra", "~> 1.2.3"
gem "thin"

gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b7e3508eb9'
gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b0cc19d5'
gem 'vcap_logging', :require => ['vcap/logging'], :git => 'git://github.com/cloudfoundry/common.git', :ref => 'b96ec1192'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => '4db4cc92ce'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => 'b8a47d1b'
gem 'warden-client', :require => ['warden/client'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'
gem 'warden-protocol', :require => ['warden/protocol'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'

Expand Down
14 changes: 9 additions & 5 deletions echo/Gemfile.lock
Expand Up @@ -15,20 +15,22 @@ GIT

GIT
remote: git://github.com/cloudfoundry/vcap-common.git
revision: b7e3508eb96b86162ca385f1f46a13ecfcce359d
ref: b7e3508eb9
revision: b0cc19d5520c9849600dbd8cf2883bff66d7643e
ref: b0cc19d5
specs:
vcap_common (1.0.14)
vcap_common (2.0.4)
eventmachine
httpclient
membrane (~> 0.0.2)
nats (~> 0.4.22.beta.8)
posix-spawn (~> 0.3.6)
thin (~> 1.3.1)
yajl-ruby (~> 0.8.3)

GIT
remote: git://github.com/cloudfoundry/vcap-services-base.git
revision: 4db4cc92ce5dc83d2cce95999508dbda51b34f0b
ref: 4db4cc92ce
revision: b8a47d1bc7d8901362db938a146107ccfb4f92e4
ref: b8a47d1b
specs:
vcap_services_base (0.1.12)
curb (~> 0.7.16)
Expand Down Expand Up @@ -128,10 +130,12 @@ GEM
eventmachine_httpserver (0.2.1)
fastercsv (1.5.5)
http_parser.rb (0.5.3)
httpclient (2.2.5)
json (1.4.6)
json_pure (1.7.3)
macaddr (1.6.1)
systemu (~> 2.5.0)
membrane (0.0.2)
multi_json (1.3.6)
nats (0.4.24)
daemons (>= 1.1.5)
Expand Down
Binary file added echo/vendor/cache/httpclient-2.2.5.gem
Binary file not shown.
Binary file added echo/vendor/cache/membrane-0.0.2.gem
Binary file not shown.
4 changes: 2 additions & 2 deletions elasticsearch/Gemfile
Expand Up @@ -10,9 +10,9 @@ gem "sinatra"
gem "thin"
gem "rest-client"

gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b7e3508eb9'
gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b0cc19d5'
gem 'vcap_logging', :require => ['vcap/logging'], :git => 'git://github.com/cloudfoundry/common.git', :ref => 'b96ec1192'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => '4db4cc92ce'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => 'b8a47d1b'
gem 'warden-client', :require => ['warden/client'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'
gem 'warden-protocol', :require => ['warden/protocol'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'

Expand Down
14 changes: 9 additions & 5 deletions elasticsearch/Gemfile.lock
Expand Up @@ -15,20 +15,22 @@ GIT

GIT
remote: git://github.com/cloudfoundry/vcap-common.git
revision: b7e3508eb96b86162ca385f1f46a13ecfcce359d
ref: b7e3508eb9
revision: b0cc19d5520c9849600dbd8cf2883bff66d7643e
ref: b0cc19d5
specs:
vcap_common (1.0.14)
vcap_common (2.0.4)
eventmachine
httpclient
membrane (~> 0.0.2)
nats (~> 0.4.22.beta.8)
posix-spawn (~> 0.3.6)
thin (~> 1.3.1)
yajl-ruby (~> 0.8.3)

GIT
remote: git://github.com/cloudfoundry/vcap-services-base.git
revision: 4db4cc92ce5dc83d2cce95999508dbda51b34f0b
ref: 4db4cc92ce
revision: b8a47d1bc7d8901362db938a146107ccfb4f92e4
ref: b8a47d1b
specs:
vcap_services_base (0.1.12)
curb (~> 0.7.16)
Expand Down Expand Up @@ -128,10 +130,12 @@ GEM
eventmachine_httpserver (0.2.1)
fastercsv (1.5.5)
http_parser.rb (0.5.3)
httpclient (2.2.5)
json (1.4.6)
json_pure (1.7.3)
macaddr (1.6.1)
systemu (~> 2.5.0)
membrane (0.0.2)
mime-types (1.16)
multi_json (1.0.4)
nats (0.4.24)
Expand Down
Binary file added elasticsearch/vendor/cache/httpclient-2.2.5.gem
Binary file not shown.
Binary file added elasticsearch/vendor/cache/membrane-0.0.2.gem
Binary file not shown.
4 changes: 2 additions & 2 deletions filesystem/Gemfile
Expand Up @@ -10,9 +10,9 @@ gem "do_sqlite3"
gem "sinatra"
gem "thin"

gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b7e3508eb9'
gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b0cc19d5'
gem 'vcap_logging', :require => ['vcap/logging'], :git => 'git://github.com/cloudfoundry/common.git', :ref => 'b96ec1192'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => '4db4cc92ce'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => 'b8a47d1b'
gem 'warden-client', :require => ['warden/client'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'
gem 'warden-protocol', :require => ['warden/protocol'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'

Expand Down
14 changes: 9 additions & 5 deletions filesystem/Gemfile.lock
Expand Up @@ -15,20 +15,22 @@ GIT

GIT
remote: git://github.com/cloudfoundry/vcap-common.git
revision: b7e3508eb96b86162ca385f1f46a13ecfcce359d
ref: b7e3508eb9
revision: b0cc19d5520c9849600dbd8cf2883bff66d7643e
ref: b0cc19d5
specs:
vcap_common (1.0.14)
vcap_common (2.0.4)
eventmachine
httpclient
membrane (~> 0.0.2)
nats (~> 0.4.22.beta.8)
posix-spawn (~> 0.3.6)
thin (~> 1.3.1)
yajl-ruby (~> 0.8.3)

GIT
remote: git://github.com/cloudfoundry/vcap-services-base.git
revision: 4db4cc92ce5dc83d2cce95999508dbda51b34f0b
ref: 4db4cc92ce
revision: b8a47d1bc7d8901362db938a146107ccfb4f92e4
ref: b8a47d1b
specs:
vcap_services_base (0.1.12)
curb (~> 0.7.16)
Expand Down Expand Up @@ -128,10 +130,12 @@ GEM
eventmachine_httpserver (0.2.1)
fastercsv (1.5.5)
http_parser.rb (0.5.3)
httpclient (2.2.5)
json (1.4.6)
json_pure (1.7.3)
macaddr (1.6.1)
systemu (~> 2.5.0)
membrane (0.0.2)
multi_json (1.0.4)
nats (0.4.24)
daemons (>= 1.1.5)
Expand Down
8 changes: 1 addition & 7 deletions filesystem/lib/filesystem_service/base_provisioner.rb
Expand Up @@ -118,18 +118,12 @@ def provision_service(request, prov_handle=nil, &blk)

credentials = gen_credentials(name, backend)
svc = {
:data => prov_req.dup,
:service_id => name,
:credentials => credentials
}
# FIXME: workaround for inconsistant representation of bind handle and provision handle
svc_local = {
:configuration => prov_req.dup,
:service_id => name,
:credentials => credentials
}
@logger.debug("Provisioned #{svc.inspect}")
@prov_svcs[svc[:service_id]] = svc_local
@prov_svcs[svc[:service_id]] = svc
blk.call(success(svc))
rescue => e
if e.instance_of? FilesystemError
Expand Down
2 changes: 1 addition & 1 deletion filesystem/spec/provisioner_spec.rb
Expand Up @@ -112,7 +112,7 @@ class BaseProvisioner
it "should return the credentials when provision successful" do
@provisioner.provision_service(@request) do |msg|
msg["success"].should == true
msg["response"][:data][:plan].should == "free"
msg["response"][:configuration][:plan].should == "free"
msg["response"][:service_id].should be
msg["response"][:credentials]["internal"].should be
msg["response"][:credentials]["internal"]["name"].should be
Expand Down
Binary file added filesystem/vendor/cache/httpclient-2.2.5.gem
Binary file not shown.
Binary file added filesystem/vendor/cache/membrane-0.0.2.gem
Binary file not shown.
4 changes: 2 additions & 2 deletions memcached/Gemfile
Expand Up @@ -10,9 +10,9 @@ gem "sinatra"
gem "thin"
gem "dalli"

gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b7e3508eb9'
gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b0cc19d5'
gem 'vcap_logging', :require => ['vcap/logging'], :git => 'git://github.com/cloudfoundry/common.git', :ref => 'b96ec1192'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => '4db4cc92ce'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => 'b8a47d1b'
gem 'warden-client', :require => ['warden/client'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'
gem 'warden-protocol', :require => ['warden/protocol'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'

Expand Down
14 changes: 9 additions & 5 deletions memcached/Gemfile.lock
Expand Up @@ -15,20 +15,22 @@ GIT

GIT
remote: git://github.com/cloudfoundry/vcap-common.git
revision: b7e3508eb96b86162ca385f1f46a13ecfcce359d
ref: b7e3508eb9
revision: b0cc19d5520c9849600dbd8cf2883bff66d7643e
ref: b0cc19d5
specs:
vcap_common (1.0.14)
vcap_common (2.0.4)
eventmachine
httpclient
membrane (~> 0.0.2)
nats (~> 0.4.22.beta.8)
posix-spawn (~> 0.3.6)
thin (~> 1.3.1)
yajl-ruby (~> 0.8.3)

GIT
remote: git://github.com/cloudfoundry/vcap-services-base.git
revision: 4db4cc92ce5dc83d2cce95999508dbda51b34f0b
ref: 4db4cc92ce
revision: b8a47d1bc7d8901362db938a146107ccfb4f92e4
ref: b8a47d1b
specs:
vcap_services_base (0.1.12)
curb (~> 0.7.16)
Expand Down Expand Up @@ -129,10 +131,12 @@ GEM
eventmachine_httpserver (0.2.1)
fastercsv (1.5.5)
http_parser.rb (0.5.3)
httpclient (2.2.5)
json (1.4.6)
json_pure (1.7.3)
macaddr (1.6.1)
systemu (~> 2.5.0)
membrane (0.0.2)
multi_json (1.3.6)
nats (0.4.24)
daemons (>= 1.1.5)
Expand Down
Binary file added memcached/vendor/cache/httpclient-2.2.5.gem
Binary file not shown.
Binary file added memcached/vendor/cache/membrane-0.0.2.gem
Binary file not shown.
4 changes: 2 additions & 2 deletions mongodb/Gemfile
Expand Up @@ -13,9 +13,9 @@ gem "bson_ext"
gem "thin"
gem "sinatra"

gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b7e3508eb9'
gem 'vcap_common', :require => ['vcap/common', 'vcap/component'], :git => 'git://github.com/cloudfoundry/vcap-common.git', :ref => 'b0cc19d5'
gem 'vcap_logging', :require => ['vcap/logging'], :git => 'git://github.com/cloudfoundry/common.git', :ref => 'b96ec1192'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => '4db4cc92ce'
gem 'vcap_services_base', :git => 'git://github.com/cloudfoundry/vcap-services-base.git', :ref => 'b8a47d1b'
gem 'warden-client', :require => ['warden/client'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'
gem 'warden-protocol', :require => ['warden/protocol'], :git => 'git://github.com/cloudfoundry/warden.git', :ref => 'd8334ce8a3'

Expand Down

0 comments on commit 9295d12

Please sign in to comment.