47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/chef/knife/cosmic_iso_list.rb', line 47
def run
validate_base_options
columns = [
'Name :name',
'Account :account',
'Domain :domain',
'Public :ispublic',
'Size :size',
'OS :ostypename'
]
params = { 'command' => "listIsos" }
params['filter'] = locate_config_value(:filter) if locate_config_value(:filter)
params['keyword'] = locate_config_value(:keyword) if locate_config_value(:keyword)
params['listall'] = locate_config_value(:listall) if locate_config_value(:listall)
params['name'] = locate_config_value(:name) if locate_config_value(:name)
if ['all','featured','self','selfexecutable','sharedexecutable','executable','community'].include?(locate_config_value(:templatefilter))
params['isofilter'] = locate_config_value(:isofilter)
else
params['isofilter'] = 'featured'
end
result = connection.list_object(params, "iso")
result.each do |r|
r['size'] = human_file_size(r['size']) if r['size']
end
list_object(columns, result)
end
|