lib/cloudstack-cli/option_resolver.rb in cloudstack-cli-1.5.6 vs lib/cloudstack-cli/option_resolver.rb in cloudstack-cli-1.5.7
- old
+ new
@@ -238,7 +238,18 @@
options[:host_id] = host['id']
end
options
end
+ def resolve_cluster
+ if options[:cluster]
+ unless cluster = client.list_clusters(name: options[:cluster]).first
+ say "Error: Cluster '#{options[:cluster]}' not found.", :red
+ exit 1
+ end
+ options[:cluster_id] = cluster['id']
+ end
+ options
+ end
+
end
end