lib/cloudstack-cli/commands/stack.rb in cloudstack-cli-1.5.5 vs lib/cloudstack-cli/commands/stack.rb in cloudstack-cli-1.5.6
- old
+ new
@@ -55,11 +55,11 @@
unless options[:skip_forwarding_rules]
say "Check for port forwarding rules...", :green
jobs = []
stack["servers"].each do |instance|
string_to_array(instance["name"]).each do |name|
- if !options[:limit] || options[:limit].include?(name) && port_rules = string_to_array(instance["port_rules"])
+ if (!options[:limit] || options[:limit].include?(name)) && port_rules = string_to_array(instance["port_rules"])
server = client.list_virtual_machines(name: name, project_id: project_id).first
create_port_rules(server, port_rules, false).each_with_index do |job_id, index|
job_name = "Create port forwarding rules (#{port_rules[index]}) for VM #{name}"
jobs << {id: job_id, name: job_name}
end
@@ -88,10 +88,12 @@
stack = parse_file(stackfile)
project_id = find_project_by_name(stack["project"])
servers = []
stack["servers"].each do |server|
string_to_array(server["name"]).each do |name|
- servers << name if options[:limit].include?(name)
+ if !options[:limit] || options[:limit].include?(name)
+ servers << name
+ end
end
end
if servers.size == 0
say "No servers in stack selected.", :yellow