Class: ChefMetalCrowbar::Providers::Core

Inherits:
CrowbarDriver
  • Object
show all
Defined in:
lib/chef_metal_crowbar/providers/core.rb

Constant Summary

Constants inherited from CrowbarDriver

CrowbarDriver::AVAILABLE_DEPLOYMENT, CrowbarDriver::KEY_ATTRIB, CrowbarDriver::RESERVED_DEPLOYMENT, CrowbarDriver::TARGET_NODE_ROLE

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CrowbarDriver

#allocate_machine, #crowbar_api, from_url, #initialize, #machine_for, #ready_machine

Constructor Details

This class inherits a constructor from ChefMetalCrowbar::CrowbarDriver

Class Method Details

.compute_options_for(provider, id, config) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/chef_metal_crowbar/providers/core.rb', line 26

def self.compute_options_for(provider, id, config)
  new_compute_options = {}
  new_compute_options[:provider] = provider
  new_config = { :driver_options => { :compute_options => new_compute_options }}
  new_defaults = {
    :driver_options => { :compute_options => {} },
    :machine_options => { :bootstrap_options => {} }
  }
  result = Cheffish::MergedConfig.new(new_config, config, new_defaults)

  new_compute_options[:url] = id if (id && id != '')
  credential = Crowbar.credentials

  new_compute_options[:username] ||= credential[:username]
  new_compute_options[:password] ||= credential[:password]
  new_compute_options[:url] ||= credential[:url]

  id = result[:driver_options][:compute_options][:url]

  [result, id]
end

Instance Method Details

#creatorObject



22
23
24
# File 'lib/chef_metal_crowbar/providers/core.rb', line 22

def creator
  compute_options[:username]
end