Class: ChefMetalFog::Providers::Joyent
- Inherits:
-
FogDriver
- Object
- ChefMetal::Driver
- FogDriver
- ChefMetalFog::Providers::Joyent
show all
- Defined in:
- lib/chef_metal_fog/providers/joyent.rb
Constant Summary
Constants inherited
from FogDriver
FogDriver::DEFAULT_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from FogDriver
__new__, #allocate_machine, #allocate_machines, canonicalize_url, #compute, #compute_options, #connect_to_machine, #destroy_machine, from_provider, from_url, #image_for, inherited, #initialize, new, #provider, provider_class_for, #ready_machine, register_provider_class, #stop_machine, #transport_for
Class Method Details
.compute_options_for(provider, id, config) ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/chef_metal_fog/providers/joyent.rb', line 28
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[:joyent_url] = id if (id && id != '')
credential = Fog.credentials
new_compute_options[:joyent_username] ||= credential[:joyent_username]
new_compute_options[:joyent_password] ||= credential[:joyent_password]
new_compute_options[:joyent_keyname] ||= credential[:joyent_keyname]
new_compute_options[:joyent_keyfile] ||= credential[:joyent_keyfile]
new_compute_options[:joyent_url] ||= credential[:joyent_url]
new_compute_options[:joyent_version] ||= credential[:joyent_version]
id = result[:driver_options][:compute_options][:joyent_url]
[result, id]
end
|
Instance Method Details
#bootstrap_options_for(action_handler, machine_spec, machine_options) ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/chef_metal_fog/providers/joyent.rb', line 14
def bootstrap_options_for(action_handler, machine_spec, machine_options)
bootstrap_options = symbolize_keys(machine_options[:bootstrap_options] || {})
bootstrap_options[:tags] = default_tags(machine_spec, bootstrap_options[:tags] || {})
bootstrap_options[:tags].each do |key, val|
bootstrap_options["tag.#{key}"] = val
end
bootstrap_options[:name] ||= machine_spec.name
bootstrap_options
end
|
#creator ⇒ Object
10
11
12
|
# File 'lib/chef_metal_fog/providers/joyent.rb', line 10
def creator
compute_options[:joyent_username]
end
|