opennebula-cli 5.12.6 → 5.12.7

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: 970c8210c6b4b094cd3ca4e6eccc3257ba0b0a82
4
- data.tar.gz: c0bfee71d70b958b2a8d3b6713219c10e3609b34
3
+ metadata.gz: 6e29fa3ced9904d772fa21dce326f36ba53f5b5b
4
+ data.tar.gz: 4423b75aac339b713828c7eaf63b85b7af6a911f
5
5
  SHA512:
6
- metadata.gz: 68238d2eb49e42709bcc7685767a4a4ccadcb474619fc86307e44813953cc1c16d684a0aec2949dc1473c6a569e7e8ec8a3984f406a5b960234f81f9e1798d6d
7
- data.tar.gz: 5d4ea71d6673a794e97ab39f14f5d78dfc4c55792ae55e0452cd6284c776c3f6789066d3281e631ea3bcc1c850c316519573f18173dde926d4f39b1e80ff4fba
6
+ metadata.gz: 1a878d4aa7ab7c2cabc77f933fdc95d861ee54aa97678358efafb02aff4b3a17872ce2650d8b9087d40bae38b4e2d7e63afe17ffb7f59c29b1d2ba40ed3a9ab4
7
+ data.tar.gz: a32059c260cbea98f8ea3a22b887bc9032edd1091cd65e76944cef6adf22c4acc7b99a28aba8798e7f86d3a1791bf6e412edfc858841d82c51fcc75380a79adf
@@ -172,8 +172,13 @@ CommandParser::CmdParser.new(ARGV) do
172
172
  end_year)
173
173
 
174
174
  if OpenNebula.is_error?(rc)
175
- warn rc.message
176
- exit(-1)
175
+ if rc.message.include? "ReadTimeout"
176
+ warn "Showback calculation takes too long, continuing in background"
177
+ exit_code 0
178
+ else
179
+ warn rc.message
180
+ exit(-1)
181
+ end
177
182
  else
178
183
  puts rc
179
184
  exit_code 0
@@ -261,8 +261,11 @@ CommandParser::CmdParser.new(ARGV) do
261
261
  if !user_inputs
262
262
  user_inputs = OneTemplateHelper.get_user_inputs(t.to_hash)
263
263
  else
264
- optionals = OneTemplateHelper.get_user_inputs(t.to_hash,
265
- true)
264
+ optionals = OneTemplateHelper.get_user_inputs(
265
+ t.to_hash,
266
+ options[:user_inputs_keys],
267
+ )
268
+
266
269
  user_inputs = user_inputs + "\n" + optionals
267
270
  end
268
271
 
@@ -383,9 +383,15 @@ EOT
383
383
  :format => Array,
384
384
  :description => 'Specify the user inputs values when instantiating',
385
385
  :proc => lambda do |o, options|
386
+ # Store user inputs that has been already processed
387
+ options[:user_inputs_keys] = []
388
+
386
389
  # escape values
387
390
  options[:user_inputs].map! do |user_input|
388
391
  user_input_split = user_input.split('=')
392
+
393
+ options[:user_inputs_keys] << user_input_split[0]
394
+
389
395
  "#{user_input_split[0]}=\"#{user_input_split[1]}\""
390
396
  end
391
397
 
@@ -519,8 +525,12 @@ EOT
519
525
  @translation_hash = nil
520
526
  end
521
527
 
522
- def set_client(options)
523
- @client=OpenNebulaHelper::OneHelper.get_client(options, true)
528
+ def set_client(options, client=nil)
529
+ if client.nil?
530
+ @client=OpenNebulaHelper::OneHelper.get_client(options, true)
531
+ else
532
+ @client = client
533
+ end
524
534
  end
525
535
 
526
536
  def create_resource(options, &block)
@@ -1705,8 +1715,8 @@ EOT
1705
1715
  end
1706
1716
  end
1707
1717
 
1708
- def OpenNebulaHelper.parse_user_inputs(inputs, get_defaults = false)
1709
- unless get_defaults
1718
+ def OpenNebulaHelper.parse_user_inputs(inputs, keys = [])
1719
+ unless inputs.keys == keys
1710
1720
  puts 'There are some parameters that require user input. ' \
1711
1721
  'Use the string <<EDITOR>> to launch an editor ' \
1712
1722
  '(e.g. for multi-line inputs)'
@@ -1715,6 +1725,8 @@ EOT
1715
1725
  answers = {}
1716
1726
 
1717
1727
  inputs.each do |key, val|
1728
+ next if keys.include? key
1729
+
1718
1730
  input_cfg = val.split('|', -1)
1719
1731
 
1720
1732
  if input_cfg.length < 3
@@ -1741,11 +1753,6 @@ EOT
1741
1753
  initial.strip!
1742
1754
  end
1743
1755
 
1744
- if get_defaults
1745
- answers[key]= initial unless mandatory == 'M'
1746
- next
1747
- end
1748
-
1749
1756
  puts " * (#{key}) #{description}"
1750
1757
 
1751
1758
  header = ' '
@@ -128,15 +128,16 @@ EOT
128
128
  INT_EXP = /^-?\d+$/
129
129
  FLOAT_EXP = /^-?\d+(\.\d+)?$/
130
130
 
131
- def self.get_user_inputs(template, get_defaults = false)
131
+ def self.get_user_inputs(template, keys = [])
132
132
  user_inputs = template['VMTEMPLATE']['TEMPLATE']['USER_INPUTS']
133
133
 
134
134
  return '' unless user_inputs
135
135
 
136
- answers = OpenNebulaHelper.parse_user_inputs(user_inputs, get_defaults)
137
-
136
+ answers = OpenNebulaHelper.parse_user_inputs(user_inputs, keys)
138
137
  answers_s = ''
139
138
  answers.each do |key, val|
139
+ next unless val
140
+
140
141
  # Do not replace values that are equal to the ones already in the
141
142
  # template. Useful for cpu, mem, vcpu
142
143
  if key != template['VMTEMPLATE']['TEMPLATE'][key]
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.6
4
+ version: 5.12.7
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-04 00:00:00.000000000 Z
11
+ date: 2020-12-16 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.6
19
+ version: 5.12.7
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.6
26
+ version: 5.12.7
27
27
  description: Commands used to talk to OpenNebula
28
28
  email: contact@opennebula.io
29
29
  executables:
@@ -88,7 +88,6 @@ files:
88
88
  - lib/one_helper/onemarket_helper.rb
89
89
  - lib/one_helper/onequota_helper.rb
90
90
  - lib/one_helper/onesecgroup_helper.rb
91
- - lib/one_helper/oneuser_helper.rb
92
91
  - lib/one_helper/onevcenter_helper.rb
93
92
  - lib/one_helper/onevdc_helper.rb
94
93
  - lib/one_helper/onevm_helper.rb
@@ -104,6 +103,7 @@ files:
104
103
  - lib/one_helper/onemarketapp_helper.rb
105
104
  - lib/one_helper/oneprovision_helper.rb
106
105
  - lib/one_helper/onetemplate_helper.rb
106
+ - lib/one_helper/oneuser_helper.rb
107
107
  - lib/one_helper/onevrouter_helper.rb
108
108
  - lib/one_helper/onezone_helper.rb
109
109
  - NOTICE