bosh-registry 1.3202.0 → 1.3213.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b81190f21ff2e9c2140eb62f07d56fd1c0650875
4
- data.tar.gz: 792a21d8902e0559e96add8c5063596a10e01955
3
+ metadata.gz: a1c27de62024689057c77295714a40f64f830805
4
+ data.tar.gz: 73abc057a0d5350d5ae63a60f6c6110955a98817
5
5
  SHA512:
6
- metadata.gz: 687da0404dc11602cb2c226cfff5f1e8d107ae807db8cd954fd87f16e081ee401166a347d298fe9e6558c3c76a0c33023e60aab074244c42c9c9b955d08a0c41
7
- data.tar.gz: 7ef71932a0fd7d18aaf665203c288f84e611a0c96b0a30bd3273fcf936a2d1b07bdb8862055bb05fc499df7a81698dfae9199496c839d658aaeb8fafd693d406
6
+ metadata.gz: 9d337d567611632a265b25b7813ebfc05ce1a70693d4473f3d0feb80447c8d2ea6291c46451e451627abccddb58049309169bd5f6af656996acafae0c656bf34
7
+ data.tar.gz: 1bfc2e6616b15f660b99eae5fcadc36f7567964925a872184cb8acb3b238adea8acf70e110658280f7c44c6b98e3faf454a538b74cfedf4691e41ea6124ac92c
data/lib/bosh/registry.rb CHANGED
@@ -20,6 +20,7 @@ require "bosh/registry/api_controller"
20
20
  require "bosh/registry/config"
21
21
  require "bosh/registry/errors"
22
22
  require "bosh/registry/instance_manager"
23
+ require "bosh/registry/instance_manager/aws_credentials_provider"
23
24
  require "bosh/registry/runner"
24
25
  require "bosh/registry/version"
25
26
 
@@ -1,4 +1,3 @@
1
- # Copyright (c) 2009-2013 VMware, Inc.
2
1
 
3
2
  module Bosh::Registry
4
3
 
@@ -31,15 +30,18 @@ module Bosh::Registry
31
30
  end
32
31
 
33
32
  # credentials_source could be static (default) or env_or_profile
34
- # static credentials must be included in aws_properties
35
- # env_or_profile credentials will use the AWS DefaultCredentialsProvider
36
- # to find AWS credentials in environment variables or EC2 instance profiles
33
+ # - if "static", credentials must be provided
34
+ # - if "env_or_profile", credentials are read from instance metadata
35
+ credentials_source = cloud_config['aws']['credentials_source'] || 'static'
36
+ static_credentials = {}
37
37
 
38
- if cloud_config['aws']['credentials_source'] == 'static' || cloud_config['aws']['credentials_source'].nil?
39
- @aws_options[:access_key_id] = cloud_config['aws']['access_key_id']
40
- @aws_options[:secret_access_key] = cloud_config['aws']['secret_access_key']
38
+ if credentials_source == 'static'
39
+ static_credentials[:access_key_id] = cloud_config['aws']['access_key_id']
40
+ static_credentials[:secret_access_key] = cloud_config['aws']['secret_access_key']
41
41
  end
42
42
 
43
+ @aws_options[:credential_provider] = Bosh::Registry::AWSCredentialsProvider.new(static_credentials)
44
+
43
45
  @ec2 = AWS::EC2.new(@aws_options)
44
46
  end
45
47
 
@@ -0,0 +1,12 @@
1
+ module Bosh::Registry
2
+
3
+ class AWSCredentialsProvider < AWS::Core::CredentialProviders::DefaultProvider
4
+ DEFAULT_RETRIES = 10
5
+
6
+ def initialize(static_credentials = {})
7
+ @providers = []
8
+ @providers << AWS::Core::CredentialProviders::StaticProvider.new(static_credentials)
9
+ @providers << AWS::Core::CredentialProviders::EC2Provider.new(:retries => DEFAULT_RETRIES)
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Registry
3
- VERSION = '1.3202.0'
3
+ VERSION = '1.3213.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-registry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3202.0
4
+ version: 1.3213.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.3202.0
103
+ version: 1.3213.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.3202.0
110
+ version: 1.3213.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -225,6 +225,7 @@ files:
225
225
  - lib/bosh/registry/errors.rb
226
226
  - lib/bosh/registry/instance_manager.rb
227
227
  - lib/bosh/registry/instance_manager/aws.rb
228
+ - lib/bosh/registry/instance_manager/aws_credentials_provider.rb
228
229
  - lib/bosh/registry/instance_manager/openstack.rb
229
230
  - lib/bosh/registry/models.rb
230
231
  - lib/bosh/registry/models/registry_instance.rb