opennebula-cli 6.0.0.1 → 6.0.3

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: 744bd1ffb1ad108ad3ebfac08a3e7a0f2e12eea0
4
- data.tar.gz: d6d8d5f7a701b7252ae828bbcc00c35705e29275
3
+ metadata.gz: d71d6197859d846259af7cb730330d8d29a03e89
4
+ data.tar.gz: 515adb9afa80cf52f7ab93ac9a582af9bc38afc8
5
5
  SHA512:
6
- metadata.gz: f468a81b851acbd4b453b4c2248092544c99bcc41af5ee9b42ae67bf87251fc74ec5acf4f26ca48cc31d63075522b97053e56158bf411d15312dcef89fa840e8
7
- data.tar.gz: 53662ad598df3da566a839f114e7451e9fdd1392ae14487ee733ba858cc812a050df98579ea6fcec70774c63ad17f12dcfdeef399a40e3471687b3b19d2fe937
6
+ metadata.gz: 02cfddcd26f6d496448f69653ad05f463eebf60cb5d40a956319faaed2f9b4829db13e75b9154168e3a0597a3cf2f20739229ce9758b2ce537f535c9f5a5e644
7
+ data.tar.gz: 8409cabd907844035d833f9d37b37dc08c15bf0afd276a1772c303ffa6d1a6e004985f4eefa5d440590d93f5910f209fee68bef5238aa8e206c6f806d82865e4
data/bin/oneacct CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/oneacl CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/onecluster CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/onedatastore CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/oneflow CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -417,4 +428,76 @@ CommandParser::CmdParser.new(ARGV) do
417
428
  0
418
429
  end
419
430
  end
431
+
432
+ ###
433
+
434
+ add_role_desc = <<-EOT.unindent
435
+ Add new role to running service
436
+ EOT
437
+
438
+ command :'add-role', add_role_desc, :service_id, [:file, nil] do
439
+ service_id = args[0]
440
+ client = helper.client(options)
441
+
442
+ if args[1]
443
+ path = args[1]
444
+ else
445
+ tmp = Tempfile.new(service_id.to_s)
446
+ path = tmp.path
447
+
448
+ if ENV['EDITOR']
449
+ editor_path = ENV['EDITOR']
450
+ else
451
+ editor_path = OpenNebulaHelper::EDITOR_PATH
452
+ end
453
+
454
+ system("#{editor_path} #{path}")
455
+
456
+ unless $CHILD_STATUS.exitstatus.zero?
457
+ STDERR.puts 'Editor not defined'
458
+ exit(-1)
459
+ end
460
+
461
+ tmp.close
462
+ end
463
+
464
+ params = {}
465
+ params[:role] = File.read(path)
466
+ params[:add] = true
467
+ json = Service.build_json_action('add_role', params)
468
+
469
+ response = client.post("#{RESOURCE_PATH}/#{service_id}/role_action",
470
+ json)
471
+
472
+ if CloudClient.is_error?(response)
473
+ [response.code.to_i, response.to_s]
474
+ else
475
+ 0
476
+ end
477
+ end
478
+
479
+ ###
480
+
481
+ remove_role_desc = <<-EOT.unindent
482
+ Remove role from running service
483
+ EOT
484
+
485
+ command :'remove-role', remove_role_desc, :service_id, :role_name do
486
+ service_id = args[0]
487
+ client = helper.client(options)
488
+
489
+ params = {}
490
+ params[:role] = args[1]
491
+ params[:add] = false
492
+ json = Service.build_json_action('remove_role', params)
493
+
494
+ response = client.post("#{RESOURCE_PATH}/#{service_id}/role_action",
495
+ json)
496
+
497
+ if CloudClient.is_error?(response)
498
+ [response.code.to_i, response.to_s]
499
+ else
500
+ 0
501
+ end
502
+ end
420
503
  end
data/bin/oneflow-template CHANGED
@@ -28,14 +28,25 @@ else
28
28
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
29
29
  end
30
30
 
31
+ # %%RUBYGEMS_SETUP_BEGIN%%
31
32
  if File.directory?(GEMS_LOCATION)
32
33
  real_gems_path = File.realpath(GEMS_LOCATION)
33
34
  if !defined?(Gem) || Gem.path != [real_gems_path]
34
35
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
35
- require 'rubygems'
36
- Gem.use_paths(real_gems_path)
36
+
37
+ # Suppress warnings from Rubygems
38
+ # https://github.com/OpenNebula/one/issues/5379
39
+ begin
40
+ verb = $VERBOSE
41
+ $VERBOSE = nil
42
+ require 'rubygems'
43
+ Gem.use_paths(real_gems_path)
44
+ ensure
45
+ $VERBOSE = verb
46
+ end
37
47
  end
38
48
  end
49
+ # %%RUBYGEMS_SETUP_END%%
39
50
 
40
51
  $LOAD_PATH << RUBY_LIB_LOCATION
41
52
  $LOAD_PATH << ONEFLOW_LOCATION
data/bin/onegroup CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/onehook CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -254,9 +265,9 @@ CommandParser::CmdParser.new(ARGV) do
254
265
  [Admin]: locks only Admin actions.
255
266
  EOT
256
267
 
257
- command :lock, lock_desc, :hookid,
268
+ command :lock, lock_desc, [:range, :hookid_list],
258
269
  :options => [USE, MANAGE, ADMIN, ALL] do
259
- helper.perform_action(args[0], options, 'Hook locked') do |t|
270
+ helper.perform_actions(args[0], options, 'Hook locked') do |t|
260
271
  if !options[:use].nil?
261
272
  level = 1
262
273
  elsif !options[:manage].nil?
@@ -277,8 +288,8 @@ CommandParser::CmdParser.new(ARGV) do
277
288
  Valid states are: All.
278
289
  EOT
279
290
 
280
- command :unlock, unlock_desc, :hookid do
281
- helper.perform_action(args[0], options, 'Hook unlocked') do |t|
291
+ command :unlock, unlock_desc, [:range, :hookid_list] do
292
+ helper.perform_actions(args[0], options, 'Hook unlocked') do |t|
282
293
  t.unlock
283
294
  end
284
295
  end
data/bin/onehost CHANGED
@@ -28,14 +28,25 @@ else
28
28
  REMOTES_LOCATION = ONE_LOCATION + '/var/remotes/'
29
29
  end
30
30
 
31
+ # %%RUBYGEMS_SETUP_BEGIN%%
31
32
  if File.directory?(GEMS_LOCATION)
32
33
  real_gems_path = File.realpath(GEMS_LOCATION)
33
34
  if !defined?(Gem) || Gem.path != [real_gems_path]
34
35
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
35
- require 'rubygems'
36
- Gem.use_paths(real_gems_path)
36
+
37
+ # Suppress warnings from Rubygems
38
+ # https://github.com/OpenNebula/one/issues/5379
39
+ begin
40
+ verb = $VERBOSE
41
+ $VERBOSE = nil
42
+ require 'rubygems'
43
+ Gem.use_paths(real_gems_path)
44
+ ensure
45
+ $VERBOSE = verb
46
+ end
37
47
  end
38
48
  end
49
+ # %%RUBYGEMS_SETUP_END%%
39
50
 
40
51
  $LOAD_PATH << RUBY_LIB_LOCATION
41
52
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
data/bin/oneimage CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -434,9 +445,9 @@ CommandParser::CmdParser.new(ARGV) do
434
445
  [Admin]: locks only Admin actions.
435
446
  EOT
436
447
 
437
- command :lock, lock_desc, :imageid,
448
+ command :lock, lock_desc, [:range, :imageid_list],
438
449
  :options => [USE, MANAGE, ADMIN, ALL] do
439
- helper.perform_action(args[0], options, 'Image locked') do |i|
450
+ helper.perform_actions(args[0], options, 'Image locked') do |i|
440
451
  if !options[:use].nil?
441
452
  level = 1
442
453
  elsif !options[:manage].nil?
@@ -457,8 +468,8 @@ CommandParser::CmdParser.new(ARGV) do
457
468
  Valid states are: All.
458
469
  EOT
459
470
 
460
- command :unlock, unlock_desc, :imageid do
461
- helper.perform_action(args[0], options, 'Image unlocked') do |i|
471
+ command :unlock, unlock_desc, [:range, :imageid_list] do
472
+ helper.perform_actions(args[0], options, 'Image unlocked') do |i|
462
473
  i.unlock
463
474
  end
464
475
  end
data/bin/onemarket CHANGED
@@ -26,14 +26,25 @@ else
26
26
  GEMS_LOCATION = ONE_LOCATION + '/share/gems'
27
27
  end
28
28
 
29
+ # %%RUBYGEMS_SETUP_BEGIN%%
29
30
  if File.directory?(GEMS_LOCATION)
30
31
  real_gems_path = File.realpath(GEMS_LOCATION)
31
32
  if !defined?(Gem) || Gem.path != [real_gems_path]
32
33
  $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
33
- require 'rubygems'
34
- Gem.use_paths(real_gems_path)
34
+
35
+ # Suppress warnings from Rubygems
36
+ # https://github.com/OpenNebula/one/issues/5379
37
+ begin
38
+ verb = $VERBOSE
39
+ $VERBOSE = nil
40
+ require 'rubygems'
41
+ Gem.use_paths(real_gems_path)
42
+ ensure
43
+ $VERBOSE = verb
44
+ end
35
45
  end
36
46
  end
47
+ # %%RUBYGEMS_SETUP_END%%
37
48
 
38
49
  $LOAD_PATH << RUBY_LIB_LOCATION
39
50
  $LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
@@ -188,4 +199,24 @@ CommandParser::CmdParser.new(ARGV) do
188
199
  o.rename(args[1])
189
200
  end
190
201
  end
202
+
203
+ enable_desc = <<-EOT.unindent
204
+ Enables the marketplace
205
+ EOT
206
+
207
+ command :enable, enable_desc, [:range, :marketplaceid_list] do
208
+ helper.perform_actions(args[0], options, 'enabled') do |obj|
209
+ obj.enable
210
+ end
211
+ end
212
+
213
+ disable_desc = <<-EOT.unindent
214
+ Disables the marketplace. Remove all its apps.
215
+ EOT
216
+
217
+ command :disable, disable_desc, [:range, :marketplaceid_list] do
218
+ helper.perform_actions(args[0], options, 'disabled') do |obj|
219
+ obj.disable
220
+ end
221
+ end
191
222
  end