opennebula 6.8.2 → 6.9.80.pre

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
  SHA256:
3
- metadata.gz: 5759fbb07bfb063ffa52b37dab6435776ed9d3fa2e14c686df1920d4012b7242
4
- data.tar.gz: 602088834190d1305ad873f000bab5afe75858b87ab5c9891d2d869d518bf0bc
3
+ metadata.gz: 5cf888b9c95db4f557149408182752fb7de455cd59b3f5300b2401dcb9291852
4
+ data.tar.gz: 02fa72864a8859c132397c2a7d08e5dd831ff5be9743da486f0d782ae8e166b4
5
5
  SHA512:
6
- metadata.gz: 89b9a4ac5491c5b443d30692cd198bbe4176823df5b81fcc914cbb96be8d72d19b9ca6c4ae3e8c97f8754bd745273888cedfa094a71aae9c366cca75987ed152
7
- data.tar.gz: 40f49cf1a941abc8f5e4f081393f10ec902229704c6ff24e033753b184007d5eaef8bf8d2c0dbeb255c30985b32e07508a36a1b0a2ab531c4437920dcfb436da
6
+ metadata.gz: fa192365155396fe0719ef58c97ca01b94f06f0f6bd8d8fb8c87f70b69f85d7cc3b4abe1d2d4c39c63a5419d67351b25d1f0bfa6caf0bce3f09c76e720afa2f1
7
+ data.tar.gz: cc2141821c1dc205c592f2e7d8f9200ab1b963713b83580350b22f9c551fe3ba7d8cbd670fb174b6211c83529ed064ce6bcf4356a2e1a6c47ef815d8bc17a6ba
@@ -1,4 +1,3 @@
1
- # rubocop:disable Naming/FileName
2
1
  # -------------------------------------------------------------------------- #
3
2
  # Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
4
3
  # #
@@ -216,4 +215,3 @@ module DriverExecHelper
216
215
  end
217
216
 
218
217
  end
219
- # rubocop:enable Naming/FileName
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '6.8.2'
54
+ VERSION = '6.9.80'
55
55
 
56
56
  # #########################################################################
57
57
  # Default location for the authentication file
data/lib/models/role.rb CHANGED
@@ -504,7 +504,7 @@ module OpenNebula
504
504
 
505
505
  break unless OpenNebula.is_error?(rc)
506
506
 
507
- sleep(tries * 0.5)
507
+ sleep(tries)
508
508
  end
509
509
 
510
510
  if tries == 3
@@ -839,7 +839,11 @@ module OpenNebula
839
839
 
840
840
  rc = deploy
841
841
 
842
- deployed_nodes.concat(rc[0]) if rc[1].nil?
842
+ unless rc[0]
843
+ return [false, "Error deploying nodes for role `#{name}`"]
844
+ end
845
+
846
+ deployed_nodes.concat(rc[0])
843
847
 
844
848
  deployed_nodes
845
849
  end
@@ -298,7 +298,7 @@ module OpenNebula
298
298
 
299
299
  @body['networks_values'].each do |vnet|
300
300
  vnet.each do |_, net|
301
- next if net.keys.first == 'id' && !deploy
301
+ next if net.key?('id') && !deploy
302
302
 
303
303
  ret << net['id'].to_i
304
304
  end
@@ -635,24 +635,21 @@ module OpenNebula
635
635
  end
636
636
 
637
637
  def deploy_networks(deploy = true)
638
- if deploy
639
- body = JSON.parse(self['TEMPLATE/BODY'])
640
- else
641
- body = @body
642
- end
638
+ body = if deploy
639
+ JSON.parse(self['TEMPLATE/BODY'])
640
+ else
641
+ @body
642
+ end
643
643
 
644
644
  return if body['networks_values'].nil?
645
645
 
646
646
  body['networks_values'].each do |vnet|
647
647
  vnet.each do |name, net|
648
- key = net.keys.first
648
+ next if net.key?('id')
649
649
 
650
- case key
651
- when 'id'
652
- next
653
- when 'template_id'
650
+ if net.key?('template_id')
654
651
  rc = create_vnet(name, net)
655
- when 'reserve_from'
652
+ elsif net.key?('reserve_from')
656
653
  rc = reserve(name, net)
657
654
  end
658
655
 
@@ -678,18 +675,14 @@ module OpenNebula
678
675
 
679
676
  vnets.each do |vnet|
680
677
  vnet.each do |_, net|
681
- key = net.keys.first
682
-
683
- next unless ['template_id', 'reserve_from'].include?(key)
678
+ next unless net.key?('template_id') || net.key?('reserve_from')
684
679
 
685
680
  rc = OpenNebula::VirtualNetwork.new_with_id(
686
681
  net['id'],
687
682
  @client
688
683
  ).delete
689
684
 
690
- next unless OpenNebula.is_error?(rc)
691
-
692
- vnets_failed << net['id']
685
+ vnets_failed << net['id'] if OpenNebula.is_error?(rc)
693
686
  end
694
687
  end
695
688
 
@@ -798,10 +791,7 @@ module OpenNebula
798
791
 
799
792
  next if net.nil?
800
793
 
801
- role['vm_template_contents'].gsub!(
802
- '$'+key[0],
803
- net[net.keys[0]]['id'].to_s
804
- )
794
+ role['vm_template_contents'].gsub!("$#{key[0]}", net[key[0]]['id'].to_s)
805
795
  end
806
796
  end
807
797
  end
@@ -31,7 +31,7 @@ module OpenNebula
31
31
  },
32
32
  'cardinality' => {
33
33
  :type => :integer,
34
- :default => 1,
34
+ :default => 0,
35
35
  :minimum => 0
36
36
  },
37
37
  'vm_template' => {
@@ -115,11 +115,12 @@ module OpenNebula
115
115
  #
116
116
  # @param description [String] A string containing the template of the Image.
117
117
  # @param ds_id [Integer] the target datastore ID
118
+ # @param no_check_capacity [Boolean] true to skip capacity check. Only for admins.
118
119
  #
119
120
  # @return [nil, OpenNebula::Error] nil in case of success, Error
120
121
  # otherwise
121
- def allocate(description, ds_id, check_capacity=true)
122
- super(IMAGE_METHODS[:allocate],description, ds_id, check_capacity)
122
+ def allocate(description, ds_id, no_check_capacity=false)
123
+ super(IMAGE_METHODS[:allocate],description, ds_id, no_check_capacity)
123
124
  end
124
125
 
125
126
  # Replaces the template contents
@@ -147,7 +147,9 @@ class OpenNebula::LdapAuth
147
147
 
148
148
  [@user.dn,
149
149
  @user[@options[:user_field]].first,
150
- @user[@options[:user_group_field]]]
150
+ @user[@options[:user_group_field]],
151
+ @user['memberof']
152
+ ]
151
153
  else
152
154
  result=@ldap.search(:base => name)
153
155
 
@@ -155,14 +157,21 @@ class OpenNebula::LdapAuth
155
157
  @user = result.first
156
158
  [name,
157
159
  @user[@options[:user_field]].first,
158
- @user[@options[:user_group_field]]]
160
+ @user[@options[:user_group_field]],
161
+ @user['memberof']
162
+ ]
159
163
  else
160
- [nil, nil, nil]
164
+ [nil, nil, nil, nil]
161
165
  end
162
166
  end
163
167
  end
164
168
 
165
- def is_in_group?(user, group)
169
+ def is_in_group?(user, group, memberof)
170
+ if @options[:rfc2307bis]
171
+ # compare case in-sensitive, like LDAP does
172
+ return memberof.map(&:downcase).include?(group.downcase)
173
+ end
174
+
166
175
  username = Net::LDAP::Filter.escape(
167
176
  user.first.force_encoding(Encoding::UTF_8))
168
177
  result=@ldap.search(
@@ -93,7 +93,6 @@ module OpenNebula::MarketPlaceAppExt
93
93
  # Exports an OpenNebula Image from this marketplace app
94
94
  # @param options to export the image
95
95
  # :vmtemplate_name [String] name of new image and template
96
- # :url_args [String] optional URL arguments
97
96
  # :dsid [String] Datastore id to create the image
98
97
  # :f_dsid [String] Files Datastore id
99
98
  # :notemplate [Bool] if true do not create vm_template (if any)
@@ -126,10 +125,6 @@ module OpenNebula::MarketPlaceAppExt
126
125
  FROM_APP = "#{self['ID']}"
127
126
  EOT
128
127
 
129
- if options[:url_args]
130
- tmpl << "URL_ARGS=\"#{options[:url_args]}\"\n"
131
- end
132
-
133
128
  #---------------------------------------------------------------
134
129
  # Kernel or context images stored in a files datastore
135
130
  #---------------------------------------------------------------
@@ -63,7 +63,8 @@ module OpenNebula
63
63
  :updatenic => 'vm.updatenic',
64
64
  :backupcancel => 'vm.backupcancel',
65
65
  :attachpci => 'vm.attachpci',
66
- :detachpci => 'vm.detachpci'
66
+ :detachpci => 'vm.detachpci',
67
+ :restore => 'vm.restore'
67
68
  }
68
69
 
69
70
  VM_STATE=['INIT', 'PENDING', 'HOLD', 'ACTIVE', 'STOPPED', 'SUSPENDED', 'DONE', 'FAILED',
@@ -140,7 +141,8 @@ module OpenNebula
140
141
  'HOTPLUG_SAVEAS_UNDEPLOYED',
141
142
  'HOTPLUG_SAVEAS_STOPPED',
142
143
  'BACKUP',
143
- 'BACKUP_POWEROFF'
144
+ 'BACKUP_POWEROFF',
145
+ 'RESTORE'
144
146
  ]
145
147
 
146
148
  SHORT_VM_STATES={
@@ -227,7 +229,8 @@ module OpenNebula
227
229
  'HOTPLUG_SAVEAS_UNDEPLOYED' => 'hotp',
228
230
  'HOTPLUG_SAVEAS_STOPPED' => 'hotp',
229
231
  'BACKUP' => 'back',
230
- 'BACKUP_POWEROFF' => 'back'
232
+ 'BACKUP_POWEROFF' => 'back',
233
+ 'RESTORE' => 'rest'
231
234
  }
232
235
 
233
236
  HISTORY_ACTION=[
@@ -290,7 +293,8 @@ module OpenNebula
290
293
  'sg-attach',
291
294
  'sg-detach',
292
295
  'pci-attach',
293
- 'pci-detach'
296
+ 'pci-detach',
297
+ 'restore'
294
298
  ]
295
299
 
296
300
  EXTERNAL_IP_ATTRS = [
@@ -891,6 +895,14 @@ module OpenNebula
891
895
  call(VM_METHODS[:detachpci], @pe_id, pci_id)
892
896
  end
893
897
 
898
+ # Restore the VM from backup Image
899
+ #
900
+ # @return [nil, OpenNebula::Error] nil in case of sucess, Error
901
+ # otherwise.
902
+ def restore(img_id, inc_id, disk_id)
903
+ @client.call(VM_METHODS[:restore], @pe_id, img_id, inc_id, disk_id)
904
+ end
905
+
894
906
  ########################################################################
895
907
  # Helpers to get VirtualMachine information
896
908
  ########################################################################
@@ -145,7 +145,7 @@ private
145
145
  conf_txt = File.read(conf_file)
146
146
  conf_opt = YAML::load(conf_txt)
147
147
 
148
- @options.merge!(conf_opt) if conf_opt != false
148
+ @options.merge!(conf_opt) if conf_opt
149
149
  end
150
150
  end
151
151
 
data/lib/opennebula.rb CHANGED
@@ -79,5 +79,5 @@ require 'opennebula/backupjob_pool'
79
79
  module OpenNebula
80
80
 
81
81
  # OpenNebula version
82
- VERSION = '6.8.2'
82
+ VERSION = '6.9.80'
83
83
  end
@@ -104,9 +104,6 @@ module OpenNebula
104
104
  file_name = 'monitord.conf'
105
105
 
106
106
  begin
107
- # Suppress augeas require warning message
108
- $VERBOSE = nil
109
-
110
107
  require 'augeas'
111
108
 
112
109
  aug = Augeas.create(:no_modl_autoload => true,
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.2
4
+ version: 6.9.80.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-20 00:00:00.000000000 Z
11
+ date: 2024-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "<"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.16'
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: '0'
26
+ version: '1.16'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -258,11 +258,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
258
258
  version: '0'
259
259
  required_rubygems_version: !ruby/object:Gem::Requirement
260
260
  requirements:
261
- - - ">="
261
+ - - ">"
262
262
  - !ruby/object:Gem::Version
263
- version: '0'
263
+ version: 1.3.1
264
264
  requirements: []
265
- rubygems_version: 3.1.2
265
+ rubygems_version: 3.3.5
266
266
  signing_key:
267
267
  specification_version: 4
268
268
  summary: OpenNebula Client API