Feature #2120: Show shutdown_action in CLI

This commit is contained in:
Carlos Martín committed 2013-06-21 11:43:44 +02:00
1 parent eb50a24848
commit bd592c6a5b
3 files changed
+5 -4

No files matched your search

+3 -1
View File
@@ -191,6 +191,7 @@ def show_service(client, args, options)
puts str % ["STRATEGY", template['deployment']]
puts str % ["SERVICE STATE", Service.state_str(template['state'])]
puts str % ["SHUTDOWN", template['shutdown_action']] if template['shutdown_action']
puts
@@ -212,8 +213,9 @@ def show_service(client, args, options)
puts str % ["ROLE STATE", Role.state_str(role['state'])]
puts str % ["PARENTS", role['parents'].join(', ')] if role['parents']
puts str % ["CARNIDALITY", role['cardinality']||1]
puts str % ["CARNIDALITY", role['cardinality']]
puts str % ["VM TEMPLATE", role['vm_template']]
puts str % ["SHUTDOWN", role['shutdown_action']] if role['shutdown_action']
puts "NODES INFORMATION"
NODE_TABLE.show(role['nodes'])
-3
View File
@@ -291,10 +291,7 @@ post '/service/:id/role/:role_name/action' do
if role.nil?
rc = OpenNebula::Error.new("Role '#{params[:role_name]}' not found")
else
# TODO: opts['period'], opts['number'] check be integer
# Use defaults only if one of the options is supplied
if opts['period'].nil? ^ opts['number'].nil?
opts['period'] = conf[:action_period] if opts['period'].nil?
opts['number'] = conf[:action_number] if opts['number'].nil?
+2
View File
@@ -406,6 +406,8 @@ module OpenNebula
def batch_action(action, period, vms_per_period)
vms_id = []
# TODO: check action is a valid string, period vm_per_period integer
error_msgs = []
nodes = @body['nodes']
now = Time.now.to_i