opennebula-cli 5.12.0.4 → 5.12.1

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: 2648488d15b5d036a3e5a41e6df716ac9358df47
4
- data.tar.gz: 0854d2925cfe7fd0b84cf28212137fd76c75317f
3
+ metadata.gz: bf6e5e798b363cb760c687cb5fd21a53f172e79f
4
+ data.tar.gz: 6c49c0c55816e6f9cdc9560b0339d87fdf5f03c9
5
5
  SHA512:
6
- metadata.gz: 19d857a5b4e66972ce8b573744ce98a6da7750504e9a9754b6a22b58281092660314dbad20a425db4422a088670ec0d0af794f870534ace98f7333f82361ff5c
7
- data.tar.gz: 283bce4816b2f1fb1181fd8b697dd8094806567ba96cced3c5e91e91e8faf606df85a070086141951094e594cf2dce659d2ae029f2c8adfe31a4b946071c9f53
6
+ metadata.gz: 1555cc93d12c2358037c19491fd81f12a94554038a9fe8b720222a0a687ce4cd97149bef414f00784d70df774182cde5c10f0431a796af418b700d5cca7b04e2
7
+ data.tar.gz: 09174b70d83b62c5cedab69f75c6d1b29adee105153ae80970e2fda19a0a77d5152ba1d56d17b2bd1bfa49a0d3216c7e8a9fc528e012af9d9c327202c93fa0e2
data/bin/onevcenter CHANGED
@@ -155,7 +155,6 @@ CommandParser::CmdParser.new(ARGV) do
155
155
  begin
156
156
  args = helper.parse_opts(options)
157
157
  args[:filter] = true
158
- args[:short] = true
159
158
  vi_client = VCenterDriver::VIClient.new_from_host(options[:host])
160
159
  importer = VCenterDriver::VcImporter
161
160
  .new_child(helper.client, vi_client, options[:object])
@@ -186,7 +185,6 @@ CommandParser::CmdParser.new(ARGV) do
186
185
  begin
187
186
  args = helper.parse_opts(options)
188
187
  args[:filter] = false
189
- args[:short] = true
190
188
  vi_client = VCenterDriver::VIClient.new_from_host(options[:host])
191
189
  importer = VCenterDriver::VcImporter
192
190
  .new_child(helper.client, vi_client, options[:object])
data/bin/onevm CHANGED
@@ -1250,12 +1250,7 @@ CommandParser::CmdParser.new(ARGV) do
1250
1250
  helper.perform_action(args[0], options,
1251
1251
  'Updating VM configuration') do |vm|
1252
1252
  if template.empty?
1253
- rc = vm.info
1254
-
1255
- if OpenNebula.is_error?(rc)
1256
- STDERR.puts "ERROR: #{rc.message}"
1257
- exit(-1)
1258
- end
1253
+ vm.info
1259
1254
 
1260
1255
  template = vm.template_like_str('TEMPLATE', true,
1261
1256
  'OS | FEATURES | INPUT | '\
data/lib/cli_helper.rb CHANGED
@@ -325,10 +325,9 @@ module CLIHelper
325
325
  column[:size] = 5
326
326
 
327
327
  conf.each do |c|
328
- case c
329
- when Symbol
328
+ if c.is_a? Symbol
330
329
  column[c] = true
331
- when Hash
330
+ elsif c.is_a? Hash
332
331
  c.each do |key, value|
333
332
  column[key] = value
334
333
  end
@@ -532,7 +531,7 @@ module CLIHelper
532
531
  # @param data [Array] Array with data to show
533
532
  # @param del [Char] CSV delimiter
534
533
  def print_csv_data(data, del)
535
- del ||= ','
534
+ del ? del = del : del = ','
536
535
 
537
536
  data.each do |l|
538
537
  result = []
@@ -668,9 +667,7 @@ module CLIHelper
668
667
  def expand_columns(expand_columns, all = false)
669
668
  return if expand_columns.empty?
670
669
 
671
- if $stdout.isatty
672
- terminal_size = $stdout.winsize[1]
673
- elsif IO.console && IO.console.tty?
670
+ if $stdout.tty? || (IO.console && IO.console.tty?)
674
671
  terminal_size = IO.console.winsize[1]
675
672
  else
676
673
  terminal_size = nil
@@ -115,7 +115,7 @@ class OneAclHelper < OpenNebulaHelper::OneHelper
115
115
  def format_pool(_options)
116
116
  config_file = self.class.table_conf
117
117
 
118
- CLIHelper::ShowTable.new(config_file, self) do
118
+ table = CLIHelper::ShowTable.new(config_file, self) do
119
119
  column :ID,
120
120
  'Rule Identifier',
121
121
  :size => 5 do |d|
@@ -157,6 +157,8 @@ class OneAclHelper < OpenNebulaHelper::OneHelper
157
157
 
158
158
  default :ID, :USER, :RES_VHNIUTGDCOZSvRMAPt, :RID, :OPE_UMAC, :ZONE
159
159
  end
160
+
161
+ table
160
162
  end
161
163
  # rubocop:enable Lint/IneffectiveAccessModifier
162
164
 
@@ -94,7 +94,7 @@ class OneHookHelper < OpenNebulaHelper::OneHelper
94
94
  def format_pool(_options)
95
95
  config_file = self.class.table_conf
96
96
 
97
- CLIHelper::ShowTable.new(config_file, self) do
97
+ table = CLIHelper::ShowTable.new(config_file, self) do
98
98
  column :ID, 'ONE identifier for the Hook', :size => 5 do |d|
99
99
  d['ID']
100
100
  end
@@ -109,6 +109,8 @@ class OneHookHelper < OpenNebulaHelper::OneHelper
109
109
 
110
110
  default :ID, :NAME, :TYPE
111
111
  end
112
+
113
+ table
112
114
  end
113
115
 
114
116
  # Function to print Execution Log records as sent by oned using:
@@ -161,11 +163,7 @@ class OneHookHelper < OpenNebulaHelper::OneHelper
161
163
  end
162
164
  end
163
165
 
164
- if !header
165
- default :HOOK, :ID, :TIMESTAMP, :RC, :EXECUTION
166
- else
167
- default :ID, :TIMESTAMP, :RC, :EXECUTION
168
- end
166
+ default :HOOK, :ID, :TIMESTAMP, :RC, :EXECUTION
169
167
  end
170
168
 
171
169
  table.show(execs, :stat_column => :EXECUTION)
@@ -103,7 +103,7 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
103
103
  def format_pool(options)
104
104
  config_file = self.class.table_conf
105
105
 
106
- CLIHelper::ShowTable.new(config_file, self) do
106
+ table = CLIHelper::ShowTable.new(config_file, self) do
107
107
  column :ID, 'ONE identifier for Host', :size => 4 do |d|
108
108
  d['ID']
109
109
  end
@@ -233,6 +233,8 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
233
233
  default :ID, :NAME, :CLUSTER, :TVM,
234
234
  :ALLOCATED_CPU, :ALLOCATED_MEM, :STAT
235
235
  end
236
+
237
+ table
236
238
  end
237
239
 
238
240
  def set_hybrid(type, path)
@@ -20,10 +20,6 @@ require 'one_helper/onevm_helper'
20
20
  # CLI helper for oneimage command
21
21
  class OneImageHelper < OpenNebulaHelper::OneHelper
22
22
 
23
- # This list contains prefixes that should skip adding user home to the path
24
- # This must have the same content as the case $FROM in downloader.sh
25
- PREFIXES = %w[http https ssh s3 rbd vcenter lxd docker]
26
-
27
23
  TEMPLATE_OPTIONS=[
28
24
  {
29
25
  :name => 'name',
@@ -86,7 +82,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
86
82
  :description => 'Path of the image file',
87
83
  :format => String,
88
84
  :proc => lambda do |o, _options|
89
- next [0, o] if o.match(%r{^(#{PREFIXES.join('|')})://})
85
+ next [0, o] if o.match(%r{^(https?|docker)://})
90
86
 
91
87
  if o[0, 1]=='/'
92
88
  path=o
@@ -196,7 +192,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
196
192
  def format_pool(options)
197
193
  config_file = self.class.table_conf
198
194
 
199
- CLIHelper::ShowTable.new(config_file, self) do
195
+ table = CLIHelper::ShowTable.new(config_file, self) do
200
196
  column :ID, 'ONE identifier for the Image', :size=>4 do |d|
201
197
  d['ID']
202
198
  end
@@ -250,6 +246,8 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
250
246
  default :ID, :USER, :GROUP, :NAME, :DATASTORE, :SIZE, :TYPE,
251
247
  :PERSISTENT, :STAT, :RVMS
252
248
  end
249
+
250
+ table
253
251
  end
254
252
 
255
253
  def check_orphans
@@ -49,7 +49,7 @@ class OneProvisionHelper < OpenNebulaHelper::OneHelper
49
49
  def format_pool
50
50
  config_file = self.class.table_conf
51
51
 
52
- CLIHelper::ShowTable.new(config_file, self) do
52
+ table = CLIHelper::ShowTable.new(config_file, self) do
53
53
  column :ID, 'Identifier for the Provision', :size => 36 do |p|
54
54
  p['ID']
55
55
  end
@@ -80,6 +80,8 @@ class OneProvisionHelper < OpenNebulaHelper::OneHelper
80
80
 
81
81
  default :ID, :NAME, :CLUSTERS, :HOSTS, :NETWORKS, :DATASTORES, :STAT
82
82
  end
83
+
84
+ table
83
85
  end
84
86
 
85
87
  #######################################################################
@@ -226,9 +228,11 @@ class OneProvisionHelper < OpenNebulaHelper::OneHelper
226
228
  end
227
229
 
228
230
  def names_to_ids(objects, type)
229
- [objects].flatten.map do |obj|
231
+ objects = [objects].flatten.map do |obj|
230
232
  OpenNebulaHelper.rname_to_id(obj.to_s, type)[1]
231
233
  end
234
+
235
+ objects
232
236
  end
233
237
 
234
238
  def get_list(provision_list)
@@ -201,10 +201,6 @@ class OneUserHelper < OpenNebulaHelper::OneHelper
201
201
  login_client = self.get_login_client(username, options)
202
202
  end
203
203
 
204
- if (login_client.is_a? Array) && login_client[0] == -1
205
- return login_client
206
- end
207
-
208
204
  user = OpenNebula::User.new(User.build_xml, login_client)
209
205
 
210
206
  egid = options[:group] || -1
@@ -100,8 +100,7 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
100
100
  if File.file?(o)
101
101
  options[:file] = o
102
102
  else
103
- STDERR.puts "File `#{options[:file]}` doesn't exist"
104
- exit(-1)
103
+ exit - 1
105
104
  end
106
105
  }
107
106
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.12.0.4
4
+ version: 5.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-20 00:00:00.000000000 Z
11
+ date: 2020-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opennebula
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.12.0.4
19
+ version: 5.12.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.12.0.4
26
+ version: 5.12.1
27
27
  description: Commands used to talk to OpenNebula
28
28
  email: contact@opennebula.io
29
29
  executables: