bosh_cpi 1.2597.0 → 1.2603.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ module Bosh::Clouds
2
+ class Provider
3
+ def self.create(cloud_config, director_uuid)
4
+ if cloud_config.fetch('external_cpi', {}).fetch('enabled', false)
5
+ ExternalCpiProvider.create(cloud_config['external_cpi'], director_uuid)
6
+ else
7
+ PluginCloudProvider.create(cloud_config['plugin'], cloud_config['properties'])
8
+ end
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ class PluginCloudProvider
15
+ def self.create(plugin, options)
16
+ begin
17
+ require "cloud/#{plugin}"
18
+ rescue LoadError => error
19
+ raise CloudError, "Could not load Cloud Provider Plugin: #{plugin}, with error #{error.inspect}"
20
+ end
21
+
22
+ Bosh::Clouds.const_get(plugin.capitalize).new(options)
23
+ end
24
+ end
25
+
26
+ class ExternalCpiProvider
27
+ def self.create(external_cpi_config, director_uuid)
28
+ ExternalCpi.new(external_cpi_config['cpi_path'], director_uuid)
29
+ end
30
+ end
31
+ end
data/lib/cloud/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Clouds
3
- VERSION = '1.2597.0'
3
+ VERSION = '1.2603.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh_cpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2597.0
4
+ version: 1.2603.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.2597.0
21
+ version: 1.2603.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,10 +26,10 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 1.2597.0
29
+ version: 1.2603.0
30
30
  description: ! 'BOSH CPI
31
31
 
32
- cf1a10'
32
+ c8849c'
33
33
  email: support@cloudfoundry.com
34
34
  executables: []
35
35
  extensions: []
@@ -45,6 +45,7 @@ files:
45
45
  - lib/cloud/config.rb
46
46
  - lib/cloud/errors.rb
47
47
  - lib/cloud/external_cpi.rb
48
+ - lib/cloud/provider.rb
48
49
  - lib/cloud/version.rb
49
50
  - README
50
51
  homepage: https://github.com/cloudfoundry/bosh
@@ -68,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
69
  version: '0'
69
70
  segments:
70
71
  - 0
71
- hash: -4592315027477372156
72
+ hash: 1314324126989618540
72
73
  requirements: []
73
74
  rubyforge_project:
74
75
  rubygems_version: 1.8.23.2