cloudstack-cli 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e275c44c299b822462e77ba0d69ea939587ba99
4
- data.tar.gz: 16635f34c875017d6c27c4a1ebd9be6a7c915c9a
3
+ metadata.gz: e84e2c0d7b3711600594a643e966594a63559ecf
4
+ data.tar.gz: 4969bcbff43220ee17ffb883261c4a102bca7f0c
5
5
  SHA512:
6
- metadata.gz: 4463ce0856dff7467b679260510438122d4ddc170024341e4c735d34fda447fde6ec70f6445fd144459bda487ef0f19ed50a9bf8f66e23780b87bfa02eb43bdf
7
- data.tar.gz: 1a0ea872edcbc76720cd98f510a43452a4fce2ad4598a0a207f449707da7bafd0849b79cc3cbbbb51b625a8d4588c61e96c7189f6830487d41ca0ce71e5ae386
6
+ metadata.gz: f0bf8526c12368a20db1b62afdba3551ec2a1b47b6580f478dcadc0113c746ca3c69ebad28c105ff4147bd967cebef6e5b62148fe975487d78a755e02cb76974
7
+ data.tar.gz: 446535092e456d529c46b33f3b9df8486d3664f9132c008df97d00552dd98cfb38020a165799492a448e5a26ca186756ed5eefda255f888252146fd21d19ce43
@@ -18,13 +18,13 @@ class Router < CloudstackCli::Base
18
18
  enum: %w(table json yaml)
19
19
  option :showid, type: :boolean, desc: "display the router ID"
20
20
  option :verbose, aliases: '-V', desc: "display additional fields"
21
+ option :version, desc: "list virtual router elements by version"
21
22
  def list
22
23
  resolve_project
23
24
  resolve_zone
24
25
  resolve_account
25
26
 
26
27
  routers = client.list_routers(options)
27
-
28
28
  # show all routers unless project or account is set
29
29
  if options[:listall] && !options[:project] && !options[:account]
30
30
  client.list_projects(listall: true).each do |project|
@@ -33,16 +33,6 @@ class Router < CloudstackCli::Base
33
33
  )
34
34
  end
35
35
  end
36
-
37
- if options[:redundant_state]
38
- routers = filter_by(
39
- routers,
40
- 'redundantstate',
41
- options[:redundant_state].downcase
42
- )
43
- end
44
-
45
- routers.reverse! if options[:reverse]
46
36
  print_routers(routers, options)
47
37
  execute_router_commands(options[:command].downcase, routers) if options[:command]
48
38
  end
@@ -58,7 +48,6 @@ class Router < CloudstackCli::Base
58
48
  enum: %w(table json yaml)
59
49
  def list_from_file(file)
60
50
  routers = parse_file(file)["routers"]
61
- routers.reverse! if options[:reverse]
62
51
  print_routers(routers, options)
63
52
  execute_router_commands(options[:command].downcase, routers) if options[:command]
64
53
  end
@@ -152,6 +141,15 @@ class Router < CloudstackCli::Base
152
141
  if routers.size < 1
153
142
  say "No routers found."
154
143
  else
144
+ if options[:redundant_state]
145
+ routers = filter_by(
146
+ routers,
147
+ 'redundantstate',
148
+ options[:redundant_state].downcase
149
+ )
150
+ end
151
+ routers.reverse! if options[:reverse]
152
+
155
153
  case options[:format].to_sym
156
154
  when :yaml
157
155
  puts({'routers' => routers}.to_yaml)
@@ -159,11 +157,11 @@ class Router < CloudstackCli::Base
159
157
  say JSON.pretty_generate(routers: routers)
160
158
  else
161
159
  table = [%w(
162
- Name Zone Account/Project IP Linklocal-IP Status
160
+ Name Zone Account/Project IP Linklocal-IP Status Version
163
161
  )]
164
162
  table[0].unshift('ID') if options[:showid]
165
163
  if options[:verbose]
166
- table[0].push('Redundant-State', 'Requ-Upgrade', 'Version', 'Offering')
164
+ table[0].push('Redundant-State', 'Requ-Upgrade', 'Offering')
167
165
  end
168
166
  routers.each do |router|
169
167
  table << [
@@ -172,14 +170,14 @@ class Router < CloudstackCli::Base
172
170
  router["project"] || router["account"],
173
171
  router["nic"] && router["nic"].first ? router["nic"].first['ipaddress'] : "-",
174
172
  router["linklocalip"] || "-",
175
- router["state"]
173
+ router["state"],
174
+ router["version"] || "-"
176
175
  ]
177
176
  table[-1].unshift(router["id"]) if options[:showid]
178
177
  if options[:verbose]
179
178
  table[-1].push(
180
179
  print_redundant_state(router),
181
180
  router["requiresupgrade"] || "-",
182
- router["version"] || "-",
183
181
  router["serviceofferingname"]
184
182
  )
185
183
  end
@@ -1,3 +1,3 @@
1
1
  module CloudstackCli
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm