Class: Bosh::Bootstrap::Network
- Inherits:
-
Object
- Object
- Bosh::Bootstrap::Network
- Defined in:
- lib/bosh-bootstrap/network.rb
Instance Attribute Summary collapse
-
#cyoi_provider_client ⇒ Object
readonly
Returns the value of attribute cyoi_provider_client.
-
#provider_name ⇒ Object
readonly
Returns the value of attribute provider_name.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(provider_name, cyoi_provider_client, settings) ⇒ Network
constructor
A new instance of Network.
-
#network_provider ⇒ Object
Attempt to load and instantiate a NetworkProviders class Else return NetworkProviders::Dummy which does nothing.
Constructor Details
#initialize(provider_name, cyoi_provider_client, settings) ⇒ Network
Returns a new instance of Network.
10 11 12 13 14 |
# File 'lib/bosh-bootstrap/network.rb', line 10 def initialize(provider_name, cyoi_provider_client, settings) @provider_name = provider_name @cyoi_provider_client = cyoi_provider_client @settings = settings end |
Instance Attribute Details
#cyoi_provider_client ⇒ Object (readonly)
Returns the value of attribute cyoi_provider_client.
7 8 9 |
# File 'lib/bosh-bootstrap/network.rb', line 7 def cyoi_provider_client @cyoi_provider_client end |
#provider_name ⇒ Object (readonly)
Returns the value of attribute provider_name.
6 7 8 |
# File 'lib/bosh-bootstrap/network.rb', line 6 def provider_name @provider_name end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
8 9 10 |
# File 'lib/bosh-bootstrap/network.rb', line 8 def settings @settings end |
Instance Method Details
#deploy ⇒ Object
16 17 18 |
# File 'lib/bosh-bootstrap/network.rb', line 16 def deploy network_provider.perform(settings) end |
#network_provider ⇒ Object
Attempt to load and instantiate a NetworkProviders class Else return NetworkProviders::Dummy which does nothing
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/bosh-bootstrap/network.rb', line 22 def network_provider @network_provider ||= begin begin require "bosh-bootstrap/network_providers/#{provider_name}" klass = Bosh::Bootstrap::NetworkProviders.provider_class(provider_name) rescue LoadError klass = Bosh::Bootstrap::NetworkProviders.provider_class("dummy") end klass.new(cyoi_provider_client) end end |