ucloudstack 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef/knife/cs_product_list.rb +14 -2
- data/lib/chef/knife/cs_template_list.rb +14 -1
- metadata +2 -2
@@ -27,6 +27,14 @@ module KnifeCloudstack
|
|
27
27
|
|
28
28
|
banner "knife cs product list (options)"
|
29
29
|
|
30
|
+
option :output_type,
|
31
|
+
:short => "-O Type",
|
32
|
+
:long => "--output-type Type",
|
33
|
+
:description => "Output type json/table",
|
34
|
+
:default => "table",
|
35
|
+
:proc => Proc.new { |type| Chef::Config[:knife][:output_type] = type }
|
36
|
+
|
37
|
+
|
30
38
|
def run
|
31
39
|
|
32
40
|
connection = CloudstackClient::Connection.new(
|
@@ -58,8 +66,12 @@ module KnifeCloudstack
|
|
58
66
|
product_list << product['zoneid']
|
59
67
|
product_list << product['zonedesc']
|
60
68
|
end
|
61
|
-
|
62
|
-
|
69
|
+
|
70
|
+
if config[:output_type].eql? "table"
|
71
|
+
puts ui.list(product_list, :columns_across, 9)
|
72
|
+
else
|
73
|
+
puts products.to_json
|
74
|
+
end
|
63
75
|
end
|
64
76
|
|
65
77
|
def locate_config_value(key)
|
@@ -52,6 +52,14 @@ module KnifeCloudstack
|
|
52
52
|
:long => "--cloudstack-secret-key SECRET",
|
53
53
|
:description => "Your CloudStack secret key",
|
54
54
|
:proc => Proc.new { |key| Chef::Config[:knife][:cloudstack_secret_key] = key }
|
55
|
+
|
56
|
+
option :output_type,
|
57
|
+
:short => "-O Type",
|
58
|
+
:long => "--output-type Type",
|
59
|
+
:description => "Output type json/table",
|
60
|
+
:default => "table",
|
61
|
+
:proc => Proc.new { |type| Chef::Config[:knife][:output_type] = type }
|
62
|
+
|
55
63
|
|
56
64
|
def run
|
57
65
|
|
@@ -81,7 +89,12 @@ module KnifeCloudstack
|
|
81
89
|
template_list << t['ispublic'].to_s
|
82
90
|
template_list << t['created']
|
83
91
|
end
|
84
|
-
|
92
|
+
|
93
|
+
if config[:output_type].eql? "table"
|
94
|
+
puts ui.list(template_list, :columns_across, 6)
|
95
|
+
else
|
96
|
+
puts templates.to_json
|
97
|
+
end
|
85
98
|
|
86
99
|
end
|
87
100
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ucloudstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ryan Holmes
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2012-09-
|
16
|
+
date: 2012-09-24 00:00:00 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: chef
|