bosh-registry 1.3115.0 → 1.3120.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: f00d529566ed51b8965045687540780b9a2cf74a
4
- data.tar.gz: ab16d1900c414a8a560f86b9dc44458239f62bd8
3
+ metadata.gz: f8b138c46152a2e700ef8342892291d5ea9e21a2
4
+ data.tar.gz: 4af5dc71fdcaedeb59147d995755e3053bc8cba6
5
5
  SHA512:
6
- metadata.gz: 5126943c999c880f14f6feebb329fc9d236fac76f7af3356e98e3d3dc21fae97457d52a2fa74760291771789d8cc021178a102af0cdd6cf9423a75f4dffd25b1
7
- data.tar.gz: 948daab985ff29ba120f96ee6fbef647dfefeec4605844b42fe1a6cd88e53d8ff8593d6b2fe78c7c564994d162231428f2cd2056dce9e0c73d94126eae453ffe
6
+ metadata.gz: f046d5a6e0a9a1f8ff407ae221a563a4cc940adfda019aecd74424caec33be07c7da10392087c4ba2a108ef0faea31a5f75d65030b051f05f5eb50a273336a4c
7
+ data.tar.gz: 426aed1e1cf6e90c154f96a57d61c03fd8e89dbee9a881aaa3a2f0c1f7c40685459ca64438d239fe8a3f2432a818ea5052af026797d4f13c71ccbc2d1a92b147
@@ -25,13 +25,17 @@ module Bosh::Registry
25
25
 
26
26
  @db = connect_db(config["db"])
27
27
 
28
- plugin = config["cloud"]["plugin"]
29
- begin
30
- require "bosh/registry/instance_manager/#{plugin}"
31
- rescue LoadError
32
- raise ConfigError, "Could not find Provider Plugin: #{plugin}"
28
+ if config.has_key?("cloud")
29
+ plugin = config["cloud"]["plugin"]
30
+ begin
31
+ require "bosh/registry/instance_manager/#{plugin}"
32
+ rescue LoadError
33
+ raise ConfigError, "Could not find Provider Plugin: #{plugin}"
34
+ end
35
+ @instance_manager = Bosh::Registry::InstanceManager.const_get(plugin.capitalize).new(config["cloud"])
36
+ else
37
+ @instance_manager = Bosh::Registry::InstanceManager.new
33
38
  end
34
- @instance_manager = Bosh::Registry::InstanceManager.const_get(plugin.capitalize).new(config["cloud"])
35
39
  end
36
40
 
37
41
  def connect_db(db_config)
@@ -62,15 +66,16 @@ module Bosh::Registry
62
66
  raise ConfigError, "Database configuration is missing from config file"
63
67
  end
64
68
 
65
- unless config.has_key?("cloud") && config["cloud"].is_a?(Hash)
66
- raise ConfigError, "Cloud configuration is missing from config file"
67
- end
69
+ if config.has_key?("cloud")
70
+ unless config["cloud"].is_a?(Hash)
71
+ raise ConfigError, "Cloud configuration is missing from config file"
72
+ end
68
73
 
69
- if config["cloud"]["plugin"].nil?
70
- raise ConfigError, "Cloud plugin is missing from config file"
74
+ if config["cloud"]["plugin"].nil?
75
+ raise ConfigError, "Cloud plugin is missing from config file"
76
+ end
71
77
  end
72
78
  end
73
79
 
74
80
  end
75
-
76
81
  end
@@ -17,4 +17,6 @@ module Bosh::Registry
17
17
 
18
18
  class InstanceError < Error; end
19
19
  class InstanceNotFound < Error; code(404); end
20
+
21
+ class NotImplemented < Error; end
20
22
  end
@@ -38,6 +38,15 @@ module Bosh::Registry
38
38
  get_instance(instance_id).destroy
39
39
  end
40
40
 
41
+ ##
42
+ # Get the list of IPs belonging to this instance
43
+ # @param [String] instance_id instance id
44
+ def instance_ips(instance_id)
45
+ raise NotImplemented, "Default implementation of InstanceManager does not support " \
46
+ "IPs retrieval. Create IaaS-specific subclass and override this method " \
47
+ "if IPs verfication is needed."
48
+ end
49
+
41
50
  private
42
51
 
43
52
  def check_instance_ips(ip, instance_id)
@@ -14,7 +14,11 @@ module Bosh::Registry
14
14
  @openstack_properties = cloud_config['openstack']
15
15
 
16
16
  unless @openstack_properties['auth_url'].match(/\/tokens$/)
17
- @openstack_properties['auth_url'] = @openstack_properties['auth_url'] + '/tokens'
17
+ if is_v3? @openstack_properties['auth_url']
18
+ @openstack_properties['auth_url'] = @openstack_properties['auth_url'] + '/auth/tokens'
19
+ else
20
+ @openstack_properties['auth_url'] = @openstack_properties['auth_url'] + '/tokens'
21
+ end
18
22
  end
19
23
 
20
24
  @openstack_options = {
@@ -49,7 +53,7 @@ module Bosh::Registry
49
53
  raise ConfigError, 'Invalid OpenStack configuration parameters'
50
54
  end
51
55
 
52
- elsif cloud_config['openstack']['auth_url'].match(/v3(\.\d+)?/)
56
+ elsif is_v3? cloud_config['openstack']['auth_url']
53
57
  unless cloud_config['openstack']['domain'] && cloud_config['openstack']['project']
54
58
  raise ConfigError, 'Invalid OpenStack configuration parameters'
55
59
  end
@@ -75,6 +79,10 @@ module Bosh::Registry
75
79
  return (instance.private_ip_addresses + instance.floating_ip_addresses).compact
76
80
  end
77
81
 
82
+ private
83
+ def is_v3?(url)
84
+ url.match(/\/v3(?=\/|$)/)
85
+ end
78
86
  end
79
87
 
80
88
  end
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Registry
3
- VERSION = '1.3115.0'
3
+ VERSION = '1.3120.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.3115.0
4
+ version: 1.3120.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-23 00:00:00.000000000 Z
11
+ date: 2015-10-27 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.3115.0
103
+ version: 1.3120.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.3115.0
110
+ version: 1.3120.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement