Module: NovaDsl::NovaConsoleWrapper
Constant Summary
NovaDsl::NovaStdoutParser::IP_SEARCHER
Instance Method Summary
collapse
#parse_nova_list_stdout, #parse_nova_show_stdout
Instance Method Details
#nova_delete ⇒ Object
51
52
53
|
# File 'lib/nova/wrapper/nova_console_wrapper.rb', line 51
def nova_delete
end
|
#nova_flavor_list ⇒ Object
59
60
61
|
# File 'lib/nova/wrapper/nova_console_wrapper.rb', line 59
def nova_flavor_list
end
|
#nova_image_list ⇒ Object
55
56
57
|
# File 'lib/nova/wrapper/nova_console_wrapper.rb', line 55
def nova_image_list
end
|
#nova_list ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/nova/wrapper/nova_console_wrapper.rb', line 33
def nova_list
LOGGER.debug("Call 'nova list' ")
results = Common::system_call(:source => '~/scripts/x25novaDEV.sh') {
"/usr/local/bin/nova list"
}
vms = NovaDsl::NovaVmsContainer.new
results.each do |result|
if result[:status].eql?(0)
vms.merge!(parse_nova_list_stdout result[:out])
else
LOGGER.debug("Skipping command stdout parsing because exitstatus is #{result[:status]}")
end
end
vms
end
|
#nova_provision(configs = {}) ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/nova/wrapper/nova_console_wrapper.rb', line 14
def nova_provision(configs = {})
LOGGER.debug("Call 'nova boot' with parameters :#{configs.inspect}")
raise NovaDsl::DslMissParameter.new("Missing 'name' attribute when calling provision at wrapper") if configs[:name].nil?
Common::
raise NovaDsl::DslMissParameter.new("Missing 'image' attribute when calling provision at wrapper") if configs[:image].nil?
raise NovaDsl::DslMissParameter.new("Missing 'flavor' attribute when
calling provision at wrapper") if configs[:flavor].nil?
raise NovaDsl::DslMissParameter.new("Missing 'key' attribute when calling provision at wrapper") if configs[:key].nil?
configs[:security_groups] ||= %w(default)
configs[:source] ||= ''
Common::system_call(:source => configs[:source]){
"/usr/local/bin/nova boot --image #{configs[:image]} --flavor #{configs[:flavor]} --key_name #{configs[:key]} --security_groups #{configs[:security_groups]*','} #{configs[:name]}"
}
end
|