lib/cloudstack-cli/commands/stack.rb in cloudstack-cli-1.5.4 vs lib/cloudstack-cli/commands/stack.rb in cloudstack-cli-1.5.5

- old
+ new

@@ -11,11 +11,11 @@ project_id = find_project_by_name(stack["project"]) say "Create stack #{stack["name"]}...", :green jobs = [] stack["servers"].each do |instance| string_to_array(instance["name"]).each do |name| - if options[:limit].include?(name) + if !options[:limit] || options[:limit].include?(name) server = client.list_virtual_machines(name: name, project_id: project_id).first if server say "VM #{name} (#{server["state"]}) already exists.", :yellow jobs << { id: 0, @@ -55,10 +55,10 @@ 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].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