opennebula-cli 6.0.0 → 6.0.0.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: 03449b210a183af54660a90a3c989f5610ad58db
4
- data.tar.gz: 71df749058756def41f3bdb2f691f104451a9b5d
3
+ metadata.gz: 744bd1ffb1ad108ad3ebfac08a3e7a0f2e12eea0
4
+ data.tar.gz: d6d8d5f7a701b7252ae828bbcc00c35705e29275
5
5
  SHA512:
6
- metadata.gz: 457e1c60b5e45b3eaf7907bc664b8050dd3c76ad12d09814209b67c27f8739abc836f66c7d23dae5c090608a5371cf3713657f68ada6a57394b1c9e3f629bdbe
7
- data.tar.gz: 01b411b3548c445c4b184a3ff936d4789ce1b880df2cfdb436ad5e12bc8416fdb6d9dbc2577109b739e566e30533f28ee58ec00170eb311aede5c24c2125ef87
6
+ metadata.gz: f468a81b851acbd4b453b4c2248092544c99bcc41af5ee9b42ae67bf87251fc74ec5acf4f26ca48cc31d63075522b97053e56158bf411d15312dcef89fa840e8
7
+ data.tar.gz: 53662ad598df3da566a839f114e7451e9fdd1392ae14487ee733ba858cc812a050df98579ea6fcec70774c63ad17f12dcfdeef399a40e3471687b3b19d2fe937
@@ -481,9 +481,12 @@ module CommandParser
481
481
  begin
482
482
  rc = comm[:proc].call
483
483
 
484
- if rc.instance_of?(Array)
484
+ if rc.instance_of?(Array) && rc[0] != 0
485
+ STDERR.puts rc[1]
486
+ exit(rc[0])
487
+ elsif rc.instance_of?(Array)
485
488
  puts rc[1]
486
- exit rc.first
489
+ exit(rc[0])
487
490
  else
488
491
  exit(@exit_code || rc)
489
492
  end
@@ -537,7 +540,7 @@ module CommandParser
537
540
  begin
538
541
  @cmdparse.parse!(@args)
539
542
  rescue => e
540
- puts e.message
543
+ STDERR.puts e.message
541
544
  exit -1
542
545
  end
543
546
 
@@ -547,8 +550,8 @@ module CommandParser
547
550
  if rc[0] == 0
548
551
  @options[e[:name].to_sym] = rc[1]
549
552
  else
550
- puts rc[1]
551
- puts "option #{e[:name]}: Parsing error"
553
+ STDERR.puts rc[1]
554
+ STDERR.puts "option #{e[:name]}: Parsing error"
552
555
  exit -1
553
556
  end
554
557
  end
@@ -557,11 +560,11 @@ module CommandParser
557
560
 
558
561
  def check_args!(name, arity, args_format)
559
562
  if @args.length < arity
560
- print "Command #{name} requires "
563
+ STDERR.print "Command #{name} requires "
561
564
  if arity>1
562
- puts "#{args_format.length} parameters to run."
565
+ STDERR.puts "#{args_format.length} parameters to run."
563
566
  else
564
- puts "one parameter to run"
567
+ STDERR.puts "one parameter to run"
565
568
  end
566
569
 
567
570
  print_command_help(name)
@@ -579,11 +582,11 @@ module CommandParser
579
582
  end
580
583
  }.join(' ')
581
584
 
582
- puts "Wrong number of arguments"
585
+ STDERR.puts "Wrong number of arguments"
583
586
  if args_str.empty?
584
- puts "No argument is required"
587
+ STDERR.puts "No argument is required"
585
588
  else
586
- puts "The arguments should be: #{args_str}"
589
+ STDERR.puts "The arguments should be: #{args_str}"
587
590
  end
588
591
  exit -1
589
592
  end
@@ -613,9 +616,9 @@ module CommandParser
613
616
 
614
617
  unless argument
615
618
  if error_msg
616
- puts error_msg
619
+ STDERR.puts error_msg
617
620
  else
618
- puts "command #{name}: argument #{id} must be one of #{format.join(', ')}"
621
+ STDERR.puts "command #{name}: argument #{id} must be one of #{format.join(', ')}"
619
622
  end
620
623
  exit -1
621
624
  end
data/lib/one_helper.rb CHANGED
@@ -707,10 +707,11 @@ EOT
707
707
 
708
708
  return -1, rc.message if OpenNebula.is_error?(rc)
709
709
 
710
- _, hash = print_page(pool, options)
710
+ elements, hash = print_page(pool, options)
711
711
 
712
- if options[:ids] && elements
713
- hash.reject! do |element|
712
+ if options[:ids] && elements
713
+ arr = [hash[pool.pool_name][pool.element_name]].flatten
714
+ arr.reject! do |element|
714
715
  !options[:ids].include?(element['ID'].to_i)
715
716
  end
716
717
  end
@@ -1010,7 +1011,7 @@ EOT
1010
1011
  rc = perform_action(id,options,verbose,&block)
1011
1012
 
1012
1013
  unless rc[0]==0
1013
- puts rc[1]
1014
+ STDERR.puts rc[1]
1014
1015
  exit_code=rc[0]
1015
1016
  end
1016
1017
  end
@@ -98,13 +98,11 @@ class AcctHelper < OpenNebulaHelper::OneHelper
98
98
  }
99
99
 
100
100
  ACCT_OPTIONS = [START_TIME_ACCT, END_TIME_ACCT, USERFILTER, GROUP, HOST, XPATH, SPLIT]
101
- SHOWBACK_OPTIONS = [START_TIME_SHOWBACK, END_TIME_SHOWBACK, USERFILTER, GROUP]
101
+ SHOWBACK_OPTIONS = [START_TIME_SHOWBACK, END_TIME_SHOWBACK, USERFILTER, GROUP, OpenNebulaHelper::FORMAT]
102
102
 
103
103
  ACCT_OPTIONS << OpenNebulaHelper::XML
104
104
  ACCT_OPTIONS << OpenNebulaHelper::JSON
105
105
 
106
- SHOWBACK_OPTIONS += OpenNebulaHelper::FORMAT
107
-
108
106
  ACCT_TABLE = CLIHelper::ShowTable.new(self.table_conf("oneacct.yaml"), nil) do
109
107
  column :UID, "User ID", :size=>4 do |d|
110
108
  d["UID"]
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: 6.0.0
4
+ version: 6.0.0.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-06 00:00:00.000000000 Z
11
+ date: 2021-04-28 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: 6.0.0
19
+ version: 6.0.0.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: 6.0.0
26
+ version: 6.0.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement