opennebula-cli 5.12.1 → 5.12.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/onevcenter +2 -0
- data/bin/onevm +6 -1
- data/lib/cli_helper.rb +7 -4
- data/lib/one_helper/oneacl_helper.rb +1 -3
- data/lib/one_helper/onehook_helper.rb +6 -4
- data/lib/one_helper/onehost_helper.rb +1 -3
- data/lib/one_helper/oneimage_helper.rb +6 -4
- data/lib/one_helper/oneprovision_helper.rb +2 -6
- data/lib/one_helper/oneuser_helper.rb +4 -0
- data/lib/one_helper/onevm_helper.rb +2 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 970c8210c6b4b094cd3ca4e6eccc3257ba0b0a82
|
4
|
+
data.tar.gz: c0bfee71d70b958b2a8d3b6713219c10e3609b34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68238d2eb49e42709bcc7685767a4a4ccadcb474619fc86307e44813953cc1c16d684a0aec2949dc1473c6a569e7e8ec8a3984f406a5b960234f81f9e1798d6d
|
7
|
+
data.tar.gz: 5d4ea71d6673a794e97ab39f14f5d78dfc4c55792ae55e0452cd6284c776c3f6789066d3281e631ea3bcc1c850c316519573f18173dde926d4f39b1e80ff4fba
|
data/bin/onevcenter
CHANGED
@@ -155,6 +155,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
155
155
|
begin
|
156
156
|
args = helper.parse_opts(options)
|
157
157
|
args[:filter] = true
|
158
|
+
args[:short] = true
|
158
159
|
vi_client = VCenterDriver::VIClient.new_from_host(options[:host])
|
159
160
|
importer = VCenterDriver::VcImporter
|
160
161
|
.new_child(helper.client, vi_client, options[:object])
|
@@ -185,6 +186,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
185
186
|
begin
|
186
187
|
args = helper.parse_opts(options)
|
187
188
|
args[:filter] = false
|
189
|
+
args[:short] = true
|
188
190
|
vi_client = VCenterDriver::VIClient.new_from_host(options[:host])
|
189
191
|
importer = VCenterDriver::VcImporter
|
190
192
|
.new_child(helper.client, vi_client, options[:object])
|
data/bin/onevm
CHANGED
@@ -1250,7 +1250,12 @@ 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
|
-
vm.info
|
1253
|
+
rc = vm.info
|
1254
|
+
|
1255
|
+
if OpenNebula.is_error?(rc)
|
1256
|
+
STDERR.puts "ERROR: #{rc.message}"
|
1257
|
+
exit(-1)
|
1258
|
+
end
|
1254
1259
|
|
1255
1260
|
template = vm.template_like_str('TEMPLATE', true,
|
1256
1261
|
'OS | FEATURES | INPUT | '\
|
data/lib/cli_helper.rb
CHANGED
@@ -325,9 +325,10 @@ module CLIHelper
|
|
325
325
|
column[:size] = 5
|
326
326
|
|
327
327
|
conf.each do |c|
|
328
|
-
|
328
|
+
case c
|
329
|
+
when Symbol
|
329
330
|
column[c] = true
|
330
|
-
|
331
|
+
when Hash
|
331
332
|
c.each do |key, value|
|
332
333
|
column[key] = value
|
333
334
|
end
|
@@ -531,7 +532,7 @@ module CLIHelper
|
|
531
532
|
# @param data [Array] Array with data to show
|
532
533
|
# @param del [Char] CSV delimiter
|
533
534
|
def print_csv_data(data, del)
|
534
|
-
del
|
535
|
+
del ||= ','
|
535
536
|
|
536
537
|
data.each do |l|
|
537
538
|
result = []
|
@@ -667,7 +668,9 @@ module CLIHelper
|
|
667
668
|
def expand_columns(expand_columns, all = false)
|
668
669
|
return if expand_columns.empty?
|
669
670
|
|
670
|
-
if $stdout.
|
671
|
+
if $stdout.isatty
|
672
|
+
terminal_size = $stdout.winsize[1]
|
673
|
+
elsif IO.console && IO.console.tty?
|
671
674
|
terminal_size = IO.console.winsize[1]
|
672
675
|
else
|
673
676
|
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
|
-
|
118
|
+
CLIHelper::ShowTable.new(config_file, self) do
|
119
119
|
column :ID,
|
120
120
|
'Rule Identifier',
|
121
121
|
:size => 5 do |d|
|
@@ -157,8 +157,6 @@ class OneAclHelper < OpenNebulaHelper::OneHelper
|
|
157
157
|
|
158
158
|
default :ID, :USER, :RES_VHNIUTGDCOZSvRMAPt, :RID, :OPE_UMAC, :ZONE
|
159
159
|
end
|
160
|
-
|
161
|
-
table
|
162
160
|
end
|
163
161
|
# rubocop:enable Lint/IneffectiveAccessModifier
|
164
162
|
|
@@ -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
|
-
|
97
|
+
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,8 +109,6 @@ class OneHookHelper < OpenNebulaHelper::OneHelper
|
|
109
109
|
|
110
110
|
default :ID, :NAME, :TYPE
|
111
111
|
end
|
112
|
-
|
113
|
-
table
|
114
112
|
end
|
115
113
|
|
116
114
|
# Function to print Execution Log records as sent by oned using:
|
@@ -163,7 +161,11 @@ class OneHookHelper < OpenNebulaHelper::OneHelper
|
|
163
161
|
end
|
164
162
|
end
|
165
163
|
|
166
|
-
|
164
|
+
if !header
|
165
|
+
default :HOOK, :ID, :TIMESTAMP, :RC, :EXECUTION
|
166
|
+
else
|
167
|
+
default :ID, :TIMESTAMP, :RC, :EXECUTION
|
168
|
+
end
|
167
169
|
end
|
168
170
|
|
169
171
|
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
|
-
|
106
|
+
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,8 +233,6 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
|
|
233
233
|
default :ID, :NAME, :CLUSTER, :TVM,
|
234
234
|
:ALLOCATED_CPU, :ALLOCATED_MEM, :STAT
|
235
235
|
end
|
236
|
-
|
237
|
-
table
|
238
236
|
end
|
239
237
|
|
240
238
|
def set_hybrid(type, path)
|
@@ -20,6 +20,10 @@ 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
|
+
|
23
27
|
TEMPLATE_OPTIONS=[
|
24
28
|
{
|
25
29
|
:name => 'name',
|
@@ -82,7 +86,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
|
|
82
86
|
:description => 'Path of the image file',
|
83
87
|
:format => String,
|
84
88
|
:proc => lambda do |o, _options|
|
85
|
-
next [0, o] if o.match(%r{^(
|
89
|
+
next [0, o] if o.match(%r{^(#{PREFIXES.join('|')})://})
|
86
90
|
|
87
91
|
if o[0, 1]=='/'
|
88
92
|
path=o
|
@@ -192,7 +196,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
|
|
192
196
|
def format_pool(options)
|
193
197
|
config_file = self.class.table_conf
|
194
198
|
|
195
|
-
|
199
|
+
CLIHelper::ShowTable.new(config_file, self) do
|
196
200
|
column :ID, 'ONE identifier for the Image', :size=>4 do |d|
|
197
201
|
d['ID']
|
198
202
|
end
|
@@ -246,8 +250,6 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
|
|
246
250
|
default :ID, :USER, :GROUP, :NAME, :DATASTORE, :SIZE, :TYPE,
|
247
251
|
:PERSISTENT, :STAT, :RVMS
|
248
252
|
end
|
249
|
-
|
250
|
-
table
|
251
253
|
end
|
252
254
|
|
253
255
|
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
|
-
|
52
|
+
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,8 +80,6 @@ class OneProvisionHelper < OpenNebulaHelper::OneHelper
|
|
80
80
|
|
81
81
|
default :ID, :NAME, :CLUSTERS, :HOSTS, :NETWORKS, :DATASTORES, :STAT
|
82
82
|
end
|
83
|
-
|
84
|
-
table
|
85
83
|
end
|
86
84
|
|
87
85
|
#######################################################################
|
@@ -228,11 +226,9 @@ class OneProvisionHelper < OpenNebulaHelper::OneHelper
|
|
228
226
|
end
|
229
227
|
|
230
228
|
def names_to_ids(objects, type)
|
231
|
-
|
229
|
+
[objects].flatten.map do |obj|
|
232
230
|
OpenNebulaHelper.rname_to_id(obj.to_s, type)[1]
|
233
231
|
end
|
234
|
-
|
235
|
-
objects
|
236
232
|
end
|
237
233
|
|
238
234
|
def get_list(provision_list)
|
@@ -201,6 +201,10 @@ 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
|
+
|
204
208
|
user = OpenNebula::User.new(User.build_xml, login_client)
|
205
209
|
|
206
210
|
egid = options[:group] || -1
|
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.
|
4
|
+
version: 5.12.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opennebula
|
@@ -16,18 +16,19 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.12.
|
19
|
+
version: 5.12.6
|
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.
|
26
|
+
version: 5.12.6
|
27
27
|
description: Commands used to talk to OpenNebula
|
28
28
|
email: contact@opennebula.io
|
29
29
|
executables:
|
30
30
|
- oneacct
|
31
|
+
- onevcenter
|
31
32
|
- oneacl
|
32
33
|
- onecluster
|
33
34
|
- onedatastore
|
@@ -43,7 +44,6 @@ executables:
|
|
43
44
|
- oneshowback
|
44
45
|
- onetemplate
|
45
46
|
- oneuser
|
46
|
-
- onevcenter
|
47
47
|
- onevdc
|
48
48
|
- onevm
|
49
49
|
- onevmgroup
|
@@ -55,6 +55,7 @@ extensions: []
|
|
55
55
|
extra_rdoc_files: []
|
56
56
|
files:
|
57
57
|
- bin/oneacct
|
58
|
+
- bin/onevcenter
|
58
59
|
- bin/oneacl
|
59
60
|
- bin/onecluster
|
60
61
|
- bin/onedatastore
|
@@ -70,7 +71,6 @@ files:
|
|
70
71
|
- bin/oneshowback
|
71
72
|
- bin/onetemplate
|
72
73
|
- bin/oneuser
|
73
|
-
- bin/onevcenter
|
74
74
|
- bin/onevdc
|
75
75
|
- bin/onevm
|
76
76
|
- bin/onevmgroup
|
@@ -78,25 +78,16 @@ files:
|
|
78
78
|
- bin/onevntemplate
|
79
79
|
- bin/onevrouter
|
80
80
|
- bin/onezone
|
81
|
-
- lib/cli_helper.rb
|
82
81
|
- lib/command_parser.rb
|
82
|
+
- lib/cli_helper.rb
|
83
83
|
- lib/one_helper.rb
|
84
|
-
- lib/one_helper/oneacct_helper.rb
|
85
84
|
- lib/one_helper/oneacl_helper.rb
|
86
85
|
- lib/one_helper/onecluster_helper.rb
|
87
|
-
- lib/one_helper/onedatastore_helper.rb
|
88
|
-
- lib/one_helper/oneflow_helper.rb
|
89
|
-
- lib/one_helper/oneflowtemplate_helper.rb
|
90
86
|
- lib/one_helper/onegroup_helper.rb
|
91
87
|
- lib/one_helper/onehook_helper.rb
|
92
|
-
- lib/one_helper/onehost_helper.rb
|
93
|
-
- lib/one_helper/oneimage_helper.rb
|
94
88
|
- lib/one_helper/onemarket_helper.rb
|
95
|
-
- lib/one_helper/onemarketapp_helper.rb
|
96
|
-
- lib/one_helper/oneprovision_helper.rb
|
97
89
|
- lib/one_helper/onequota_helper.rb
|
98
90
|
- lib/one_helper/onesecgroup_helper.rb
|
99
|
-
- lib/one_helper/onetemplate_helper.rb
|
100
91
|
- lib/one_helper/oneuser_helper.rb
|
101
92
|
- lib/one_helper/onevcenter_helper.rb
|
102
93
|
- lib/one_helper/onevdc_helper.rb
|
@@ -104,6 +95,15 @@ files:
|
|
104
95
|
- lib/one_helper/onevmgroup_helper.rb
|
105
96
|
- lib/one_helper/onevnet_helper.rb
|
106
97
|
- lib/one_helper/onevntemplate_helper.rb
|
98
|
+
- lib/one_helper/oneacct_helper.rb
|
99
|
+
- lib/one_helper/onedatastore_helper.rb
|
100
|
+
- lib/one_helper/oneflow_helper.rb
|
101
|
+
- lib/one_helper/oneflowtemplate_helper.rb
|
102
|
+
- lib/one_helper/onehost_helper.rb
|
103
|
+
- lib/one_helper/oneimage_helper.rb
|
104
|
+
- lib/one_helper/onemarketapp_helper.rb
|
105
|
+
- lib/one_helper/oneprovision_helper.rb
|
106
|
+
- lib/one_helper/onetemplate_helper.rb
|
107
107
|
- lib/one_helper/onevrouter_helper.rb
|
108
108
|
- lib/one_helper/onezone_helper.rb
|
109
109
|
- NOTICE
|