lib/cloudstack-cli/commands/account.rb in cloudstack-cli-0.15.1 vs lib/cloudstack-cli/commands/account.rb in cloudstack-cli-1.0.0.rc1

- old
+ new

@@ -6,15 +6,13 @@ 2 => 'admin' } desc "show NAME", "show detailed infos about an account" def show(name) - accounts = client.list_accounts(name: name) - if accounts.size < 1 + unless account = client.list_accounts(name: name).first say "No account named \"#{name}\" found.", :red else - account = accounts.first account.delete 'user' account['accounttype'] = "#{account['accounttype']} (#{TYPES[account['accounttype']]})" table = account.map do |key, value| [ set_color("#{key}", :yellow), "#{value}" ] end @@ -22,10 +20,10 @@ end end desc 'list', 'list accounts' def list - accounts = client.list_accounts + accounts = client.list_accounts(listall: true) if accounts.size < 1 puts "No accounts found." else table = [%w(Name Type Domain State)] accounts.each do |account|