opennebula-cli 5.8.2 → 5.8.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: 5d7d4554412afc55c318e69f433768f9d9f76e30
4
- data.tar.gz: d50721ae39775ca8aa48e7362df1a582af2ccc4a
3
+ metadata.gz: baa824adea5c7a61933964fd95988c4e393044c0
4
+ data.tar.gz: 9ff976adba64c246c8e3bc3d90030c86b72cb647
5
5
  SHA512:
6
- metadata.gz: 4ca74982e9f6c30957bd72a7be8644ed211a3ddca22c4e5db94a87b94b43a41c91bf3d08ee7b18f19652dbb8aa53fb90a89cf2befa4cbf0b0253ec6479292fbd
7
- data.tar.gz: ff0a2abcad71cd6f4aacaa9317586ac179a2b8cc078ecc9301bde562ce80534818217aa85ce03f958c2976f9e5fb8f4459a03bd574fd5d8b922f31706130c239
6
+ metadata.gz: 5e54c6da527153cd478e56d5169d012695ac31cea92f725394654cff0f8d3f2cdb10bf62147e45ca74e0b08c9105e4b7fe256cef173dfcea59c07aa4405c281d
7
+ data.tar.gz: 108f4299bd86ca0f3f21b0f52b90c29de29696876e3c2c6941274ccf57a75a55667ae4680d387006666d7b6394510a132a8fbe6a4e90286450ea0c228d913dbc
@@ -85,7 +85,6 @@ CommandParser::CmdParser.new(ARGV) do
85
85
 
86
86
  command :create, create_desc, :file,
87
87
  :options => [OneClusterHelper::CLUSTER] do
88
-
89
88
  cid = options[:cluster] || ClusterPool::NONE_CLUSTER_ID
90
89
 
91
90
  helper.create_resource(options) do |datastore|
@@ -717,7 +717,6 @@ CommandParser::CmdParser.new(ARGV) do
717
717
 
718
718
  command :action, action_desc, :service_id, :role_name, :vm_action,
719
719
  :options => [Service::PERIOD, Service::NUMBER] do
720
-
721
720
  client = Service::Client.new(
722
721
  :username => options[:username],
723
722
  :password => options[:password],
@@ -86,7 +86,6 @@ CommandParser::CmdParser.new(ARGV) do
86
86
 
87
87
  command :create, create_desc, [:group_name, nil], :options =>
88
88
  OpenNebulaHelper::GROUP_OPTIONS do
89
-
90
89
  if options && options[:admin_user]
91
90
  if !options[:admin_password]
92
91
  STDERR.puts 'Admin user needs password'
@@ -142,7 +142,6 @@ CommandParser::CmdParser.new(ARGV) do
142
142
  create_desc,
143
143
  [:file, nil],
144
144
  :options => CREATE_OPTIONS + OneImageHelper::TEMPLATE_OPTIONS do
145
-
146
145
  if options[:datastore].nil? && !options[:dry]
147
146
  STDERR.puts 'Datastore to save the image is mandatory: '
148
147
  STDERR.puts '\t -d datastore_id'
@@ -117,7 +117,6 @@ CommandParser::CmdParser.new(ARGV) do
117
117
  command :create, create_desc, [:file, nil],
118
118
  :options => CREATE_OPTIONS +
119
119
  OneMarketPlaceAppHelper::TEMPLATE_OPTIONS do
120
-
121
120
  if options[:marketplace].nil?
122
121
  STDERR.puts 'Marketplace to save the app is mandatory: '
123
122
  STDERR.puts '\t -m marketplace_id'
@@ -216,7 +215,6 @@ CommandParser::CmdParser.new(ARGV) do
216
215
 
217
216
  command :update, update_desc, :appid, [:file, nil],
218
217
  :options => OpenNebulaHelper::APPEND do
219
-
220
218
  helper.perform_action(args[0], options, 'modified') do |obj|
221
219
  if options[:append]
222
220
  str = OpenNebulaHelper.append_template(args[0], obj, args[1])
@@ -50,7 +50,6 @@ CommandParser::CmdParser.new(ARGV) do
50
50
  AcctHelper::SHOWBACK_OPTIONS + CommandParser::OPTIONS +
51
51
  [OpenNebulaHelper::DESCRIBE, CLIHelper::LIST, CLIHelper::CSV_OPT] +
52
52
  OpenNebulaHelper::CLIENT_OPTIONS do
53
-
54
53
  if options[:describe]
55
54
  AcctHelper::SHOWBACK_TABLE.describe_columns
56
55
  exit(0)
@@ -142,7 +141,6 @@ CommandParser::CmdParser.new(ARGV) do
142
141
 
143
142
  command :calculate, 'Calculates the showback records', :options =>
144
143
  [AcctHelper::START_TIME_SHOWBACK, AcctHelper::END_TIME_SHOWBACK] do
145
-
146
144
  start_month = -1
147
145
  start_year = -1
148
146
 
@@ -133,7 +133,6 @@ CommandParser::CmdParser.new(ARGV) do
133
133
  command :create, create_desc, [:file, nil], :options =>
134
134
  [OneTemplateHelper::VM_NAME] + OpenNebulaHelper::TEMPLATE_OPTIONS +
135
135
  [OpenNebulaHelper::DRY] do
136
-
137
136
  if args[0] && OpenNebulaHelper.create_template_options_used?(options)
138
137
  STDERR.puts 'You can not use both template file and template' \
139
138
  ' creation options.'
@@ -174,7 +173,6 @@ CommandParser::CmdParser.new(ARGV) do
174
173
 
175
174
  command :clone, clone_desc, :templateid, :name,
176
175
  :options => OneTemplateHelper::RECURSIVE do
177
-
178
176
  recursive = (options[:recursive] == true)
179
177
 
180
178
  helper.perform_action(args[0], options, 'cloned') do |t|
@@ -194,7 +192,6 @@ CommandParser::CmdParser.new(ARGV) do
194
192
 
195
193
  command :delete, delete_desc, [:range, :templateid_list],
196
194
  :options => OneTemplateHelper::RECURSIVE do
197
-
198
195
  recursive = (options[:recursive] == true)
199
196
 
200
197
  helper.perform_actions(args[0], options, 'deleted') do |t|
@@ -306,7 +303,6 @@ CommandParser::CmdParser.new(ARGV) do
306
303
 
307
304
  command :chmod, chmod_desc, [:range, :templateid_list], :octet,
308
305
  :options => OneTemplateHelper::RECURSIVE do
309
-
310
306
  recursive = (options[:recursive] == true)
311
307
 
312
308
  helper.perform_actions(args[0], options, 'Permissions changed') do |t|
@@ -359,7 +355,6 @@ CommandParser::CmdParser.new(ARGV) do
359
355
 
360
356
  command :show, show_desc, :templateid,
361
357
  :options => [OpenNebulaHelper::XML, OneTemplateHelper::EXTENDED] do
362
-
363
358
  helper.show_resource(args[0], options)
364
359
  end
365
360
 
@@ -387,7 +387,6 @@ CommandParser::CmdParser.new(ARGV) do
387
387
  command :umask, umask_desc, [:range, :userid_list], [:mask, nil] do
388
388
  helper.perform_actions(args[0], options,
389
389
  'umask changed') do |user|
390
-
391
390
  rc = user.info
392
391
 
393
392
  if OpenNebula.is_error?(rc)
@@ -583,7 +582,6 @@ CommandParser::CmdParser.new(ARGV) do
583
582
 
584
583
  command :passwdsearch, passwdsearch_desc, :driver, :password,
585
584
  :options => [CLIHelper::CSV_OPT, OpenNebulaHelper::XML] do
586
-
587
585
  options[:list] = %w[ID NAME AUTH PASSWORD]
588
586
  options[:filter] = ["AUTH=#{args[0]}", "PASSWORD=#{args[1]}"]
589
587
 
@@ -619,7 +617,6 @@ CommandParser::CmdParser.new(ARGV) do
619
617
 
620
618
  command :"token-create", token_add_desc, [:username, nil],
621
619
  :options => login_options do
622
-
623
620
  helper.token_create(args, options)
624
621
  end
625
622
 
@@ -649,7 +646,6 @@ CommandParser::CmdParser.new(ARGV) do
649
646
 
650
647
  command :"token-set", token_set_desc, [:username, nil],
651
648
  :options => login_options + set_options do
652
-
653
649
  username = args[0]
654
650
 
655
651
  if username
@@ -732,7 +728,6 @@ CommandParser::CmdParser.new(ARGV) do
732
728
 
733
729
  command :"token-delete", token_delete_desc, [:username, nil], :token,
734
730
  :options => login_options do
735
-
736
731
  if args.length == 1
737
732
  token_hint = args[0]
738
733
  else
@@ -794,7 +789,6 @@ CommandParser::CmdParser.new(ARGV) do
794
789
 
795
790
  command :"token-delete-all", token_delete_all, :username,
796
791
  :options => login_options do
797
-
798
792
  username = args[0]
799
793
 
800
794
  if username =~ /^\d+$/
data/bin/onevdc CHANGED
@@ -72,7 +72,6 @@ CommandParser::CmdParser.new(ARGV) do
72
72
  set :format, :clusterid,
73
73
  "#{OpenNebulaHelper.rname_to_id_desc('CLUSTER')}. "\
74
74
  'Can be set to ALL' do |arg|
75
-
76
75
  if !arg.nil? &&
77
76
  arg.class != Integer &&
78
77
  arg.casecmp('ALL').zero?
@@ -85,7 +84,6 @@ CommandParser::CmdParser.new(ARGV) do
85
84
  set :format, :hostid,
86
85
  "#{OpenNebulaHelper.rname_to_id_desc('HOST')}. "\
87
86
  'Can be set to ALL' do |arg|
88
-
89
87
  if !arg.nil? &&
90
88
  arg.class != Integer &&
91
89
  arg.casecmp('ALL').zero?
@@ -98,7 +96,6 @@ CommandParser::CmdParser.new(ARGV) do
98
96
  set :format, :datastoreid,
99
97
  "#{OpenNebulaHelper.rname_to_id_desc('DATASTORE')}. "\
100
98
  'Can be set to ALL' do |arg|
101
-
102
99
  if !arg.nil? &&
103
100
  arg.class != Integer &&
104
101
  arg.casecmp('ALL').zero?
@@ -111,7 +108,6 @@ CommandParser::CmdParser.new(ARGV) do
111
108
  set :format, :vnetid,
112
109
  "#{OpenNebulaHelper.rname_to_id_desc('VNET')}. "\
113
110
  'Can be set to ALL' do |arg|
114
-
115
111
  if !arg.nil? &&
116
112
  arg.class != Integer &&
117
113
  arg.casecmp('ALL').zero?
data/bin/onevm CHANGED
@@ -249,7 +249,6 @@ CommandParser::CmdParser.new(ARGV) do
249
249
  command :create, create_desc, [:file, nil], :options =>
250
250
  [OneVMHelper::MULTIPLE, OneVMHelper::HOLD] +
251
251
  OpenNebulaHelper::TEMPLATE_OPTIONS_VM do
252
-
253
252
  number = options[:multiple] || 1
254
253
  exit_code = nil
255
254
 
@@ -373,7 +372,6 @@ CommandParser::CmdParser.new(ARGV) do
373
372
 
374
373
  command :"disk-saveas", disk_saveas_desc, :vmid, :diskid, :img_name,
375
374
  :options => [TYPE, SNAP] do
376
-
377
375
  disk_id = args[1].to_i
378
376
  image_name = args[2]
379
377
  image_type = options[:type] || ''
@@ -418,7 +416,6 @@ CommandParser::CmdParser.new(ARGV) do
418
416
  OneVMHelper::HOURLY,
419
417
  OneVMHelper::END_TIME,
420
418
  OneVMHelper::HARD] do
421
-
422
419
  command_name = 'terminate'
423
420
  command_name << '-hard' if options[:hard]
424
421
 
@@ -447,7 +444,6 @@ CommandParser::CmdParser.new(ARGV) do
447
444
  OneVMHelper::HOURLY,
448
445
  OneVMHelper::END_TIME,
449
446
  OneVMHelper::HARD] do
450
-
451
447
  command_name = 'undeploy'
452
448
  command_name << '-hard' if options[:hard]
453
449
 
@@ -475,7 +471,6 @@ CommandParser::CmdParser.new(ARGV) do
475
471
  OneVMHelper::HOURLY,
476
472
  OneVMHelper::END_TIME,
477
473
  OneVMHelper::HARD] do
478
-
479
474
  command_name = 'poweroff'
480
475
  command_name << '-hard' if options[:hard]
481
476
 
@@ -505,7 +500,6 @@ CommandParser::CmdParser.new(ARGV) do
505
500
  OneVMHelper::HOURLY,
506
501
  OneVMHelper::END_TIME,
507
502
  OneVMHelper::HARD] do
508
-
509
503
  command_name = 'reboot'
510
504
  command_name << '-hard' if options[:hard]
511
505
 
@@ -711,7 +705,6 @@ CommandParser::CmdParser.new(ARGV) do
711
705
  command :"disk-attach", disk_attach_desc, :vmid,
712
706
  :options => [OneVMHelper::FILE, OneVMHelper::IMAGE,
713
707
  TARGET, CACHE, DISCARD, PREFIX] do
714
-
715
708
  if options[:file].nil? && options[:image].nil?
716
709
  STDERR.puts 'Provide a template file or an image:'
717
710
  STDERR.puts '\t--file <file>'
@@ -779,7 +772,6 @@ CommandParser::CmdParser.new(ARGV) do
779
772
  OneVMHelper::IP,
780
773
  OneVMHelper::ALIAS,
781
774
  OneVMHelper::NIC_NAME] do
782
-
783
775
  if options[:file].nil? && options[:network].nil?
784
776
  STDERR.puts 'Provide a template file or a network:'
785
777
  STDERR.puts "\t--file <file>"
@@ -924,7 +916,6 @@ CommandParser::CmdParser.new(ARGV) do
924
916
  OneVMHelper::YEARLY,
925
917
  OneVMHelper::HOURLY,
926
918
  OneVMHelper::END_TIME] do
927
-
928
919
  if !options[:schedule].nil?
929
920
  helper.schedule_actions(args[0], options, @comm_name)
930
921
  else
@@ -1099,7 +1090,6 @@ CommandParser::CmdParser.new(ARGV) do
1099
1090
  command :resize, resize_desc, :vmid,
1100
1091
  :options => OpenNebulaHelper::CAPACITY_OPTIONS_VM +
1101
1092
  [ENFORCE, OneVMHelper::FILE] do
1102
-
1103
1093
  if options[:file]
1104
1094
  template = File.read(options[:file])
1105
1095
  else
@@ -122,7 +122,6 @@ CommandParser::CmdParser.new(ARGV) do
122
122
 
123
123
  command :create, create_desc, [:file, nil], :options =>
124
124
  [OpenNebulaHelper::DRY] do
125
-
126
125
  helper.create_resource(options) do |tmpl|
127
126
  begin
128
127
  if args[0]
@@ -307,7 +306,6 @@ CommandParser::CmdParser.new(ARGV) do
307
306
 
308
307
  command :show, show_desc, :templateid,
309
308
  :options => [OpenNebulaHelper::XML, OneTemplateHelper::EXTENDED] do
310
-
311
309
  helper.show_resource(args[0], options)
312
310
  end
313
311
 
@@ -146,7 +146,6 @@ CommandParser::CmdParser.new(ARGV) do
146
146
  :vrouterid, :templateid, [:file, nil],
147
147
  :options => instantiate_options +
148
148
  OpenNebulaHelper::TEMPLATE_OPTIONS do
149
-
150
149
  if args[2] && OpenNebulaHelper.create_template_options_used?(options)
151
150
  STDERR.puts 'You cannot use both template file and template' \
152
151
  ' creation options.'
@@ -275,7 +274,6 @@ CommandParser::CmdParser.new(ARGV) do
275
274
  OneVMHelper::NETWORK,
276
275
  OneVMHelper::IP,
277
276
  OneVirtualRouterHelper::FLOAT] do
278
-
279
277
  if options[:file].nil? && options[:network].nil?
280
278
  STDERR.puts 'Provide a template file or a network:'
281
279
  STDERR.puts "\t--file <file>"
@@ -106,7 +106,6 @@ CommandParser::CmdParser.new(ARGV) do
106
106
 
107
107
  command :"server-add", addserver_desc, :zoneid, :options =>
108
108
  [OneZoneHelper::SERVER_NAME, OneZoneHelper::SERVER_ENDPOINT] do
109
-
110
109
  if options[:server_name].nil? || options[:server_rpc].nil?
111
110
  STDERR.puts 'To add a server set:'
112
111
  STDERR.puts "\t-n <server name>"
@@ -77,12 +77,31 @@ class OneZoneHelper < OpenNebulaHelper::OneHelper
77
77
  d["TEMPLATE"]['ENDPOINT']
78
78
  end
79
79
 
80
- default :CURRENT, :ID, :NAME, :ENDPOINT
80
+ column :FED_INDEX, "Federation index", :left, :size=>10 do |d|
81
+ helper.get_fed_index(d["TEMPLATE"]['ENDPOINT'])
82
+ end
83
+
84
+ default :CURRENT, :ID, :NAME, :ENDPOINT, :FED_INDEX
81
85
  end
82
86
 
83
87
  table
84
88
  end
85
89
 
90
+ def get_fed_index(endpoint)
91
+ client = OpenNebula::Client.new(nil, endpoint, :timeout => 5)
92
+ xml = client.call('zone.raftstatus')
93
+
94
+ return '-' if OpenNebula.is_error?(xml)
95
+
96
+ xml = Nokogiri::XML(xml)
97
+
98
+ if xml.xpath('RAFT/FEDLOG_INDEX')
99
+ xml.xpath('RAFT/FEDLOG_INDEX').text
100
+ else
101
+ '-'
102
+ end
103
+ end
104
+
86
105
  def set_zone(zone_id, temporary_zone)
87
106
  zone = factory(zone_id)
88
107
  rc = zone.info
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.8.2
4
+ version: 5.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2019-06-18 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.8.2
19
+ version: 5.8.3
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.8.2
26
+ version: 5.8.3
27
27
  description: Commands used to talk to OpenNebula
28
28
  email: contact@opennebula.org
29
29
  executables: