Method: CloudstackCli::OptionResolver#resolve_account

Defined in:
lib/cloudstack-cli/option_resolver.rb

#resolve_accountObject



64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/cloudstack-cli/option_resolver.rb', line 64

def 
  if options[:account]
    if  = client.list_accounts(name: options[:account], listall: true).first
      options[:account_id] = ['id']
      options[:domain_id] = ['domainid']
    else
      say "Error: Account #{options[:account]} not found.", :red
      exit 1
    end
  end
  options
end