lib/cloudstack-cli/option_resolver.rb in cloudstack-cli-1.0.7 vs lib/cloudstack-cli/option_resolver.rb in cloudstack-cli-1.0.8

- old
+ new

@@ -177,7 +177,19 @@ options[:snapshot_id] = snapshot['id'] end options end + def resolve_host(type = "routing") + if options[:host] + args = { name: options[:host], type: type, listall: true } + unless host = client.list_hosts(args).first + say "Error: Host '#{options[:host]}' not found.", :red + exit 1 + end + options[:host_id] = host['id'] + end + options + end + end end