opennebula 6.8.1 → 6.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
  SHA256:
3
- metadata.gz: bd7a4911d467d52eb65d694f92c2312c9a04571a2b846054a5807a2faca70613
4
- data.tar.gz: 71626222b92776cc9f11bdb8ed73f374c034d761161d46e2bd498aacf29e2342
3
+ metadata.gz: 8e16a4dc8d312bf0f7363eb17802682cb72bae5fc5ffad65258d520306dfb97c
4
+ data.tar.gz: c9d4605aad6a1d5d2d2600b9b0919994496942789d65c4868b6e40ccb020307e
5
5
  SHA512:
6
- metadata.gz: 7d6cf2da013b4f85775d31894d1a1400f257e45d631fe55bb35c4a487644cd94589d5ce0446f9fc3b0350167cc082a3378147657ce0944656f2fd658357b1323
7
- data.tar.gz: 84d04dfa148dd4a443050b5ac68fb0b80d8a54979816d753951ebfcbe99f8bb2716ba5c09b029f01431666b042f4bb200d5efcd4abbf1173bdd7ae92318c5975
6
+ metadata.gz: 49c4496d1a48dd35a7938f4dd9bf28c1edd75e200f2185d35f853c7db6d2a54fd5df874571248aff294ff4b9bb9b232aef6b752b1002cf3bdb7e337f6c292cd2
7
+ data.tar.gz: 268322ae279f3af5bf9e3681ead11d1553918b767ab20f68ad0c0b8ddfcf5223e1fe565b74baf4f804dac0a8e45b681dedc0454a6580eed7dd1b6328cca23786
@@ -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.1'
54
+ VERSION = '6.8.3'
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
@@ -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(
@@ -461,6 +461,10 @@ module Service
461
461
 
462
462
  req['User-Agent'] = @user_agent
463
463
 
464
+ if !@uri.path.nil?
465
+ req.instance_variable_set(:@path, @uri.path + req.path)
466
+ end
467
+
464
468
  CloudClient.http_start(@uri, @timeout) do |http|
465
469
  http.request(req)
466
470
  end
@@ -61,7 +61,9 @@ module OpenNebula
61
61
  :detachsg => 'vm.detachsg',
62
62
  :backup => 'vm.backup',
63
63
  :updatenic => 'vm.updatenic',
64
- :backupcancel => 'vm.backupcancel'
64
+ :backupcancel => 'vm.backupcancel',
65
+ :attachpci => 'vm.attachpci',
66
+ :detachpci => 'vm.detachpci'
65
67
  }
66
68
 
67
69
  VM_STATE=['INIT', 'PENDING', 'HOLD', 'ACTIVE', 'STOPPED', 'SUSPENDED', 'DONE', 'FAILED',
@@ -228,8 +230,68 @@ module OpenNebula
228
230
  'BACKUP_POWEROFF' => 'back'
229
231
  }
230
232
 
231
- HISTORY_ACTION=['none', 'migrate', 'live-migrate', 'shutdown', 'shutdown-hard', 'undeploy',
232
- 'undeploy-hard', 'hold', 'release', 'stop', 'suspend', 'resume', 'boot', 'delete', 'delete-recreate', 'reboot', 'reboot-hard', 'resched', 'unresched', 'poweroff', 'poweroff-hard', 'disk-attach', 'disk-detach', 'nic-attach', 'nic-detach', 'disk-snapshot-create', 'disk-snapshot-delete', 'terminate', 'terminate-hard', 'disk-resize', 'deploy', 'chown', 'chmod', 'updateconf', 'rename', 'resize', 'update', 'snapshot-resize', 'snapshot-delete', 'snapshot-revert', 'disk-saveas', 'disk-snapshot-revert', 'recover', 'retry', 'monitor', 'disk-snapshot-rename', 'alias-attach', 'alias-detach', 'poweroff-migrate', 'poweroff-hard-migrate', 'backup', 'nic-update']
233
+ HISTORY_ACTION=[
234
+ 'none',
235
+ 'migrate',
236
+ 'live-migrate',
237
+ 'shutdown',
238
+ 'shutdown-hard',
239
+ 'undeploy',
240
+ 'undeploy-hard',
241
+ 'hold',
242
+ 'release',
243
+ 'stop',
244
+ 'suspend',
245
+ 'resume',
246
+ 'boot',
247
+ 'delete',
248
+ 'delete-recreate',
249
+ 'reboot',
250
+ 'reboot-hard',
251
+ 'resched',
252
+ 'unresched',
253
+ 'poweroff',
254
+ 'poweroff-hard',
255
+ 'disk-attach',
256
+ 'disk-detach',
257
+ 'nic-attach',
258
+ 'nic-detach',
259
+ 'disk-snapshot-create',
260
+ 'disk-snapshot-delete',
261
+ 'terminate',
262
+ 'terminate-hard',
263
+ 'disk-resize',
264
+ 'deploy',
265
+ 'chown',
266
+ 'chmod',
267
+ 'updateconf',
268
+ 'rename',
269
+ 'resize',
270
+ 'update',
271
+ 'snapshot-resize',
272
+ 'snapshot-delete',
273
+ 'snapshot-revert',
274
+ 'disk-saveas',
275
+ 'disk-snapshot-revert',
276
+ 'recover',
277
+ 'retry',
278
+ 'monitor',
279
+ 'disk-snapshot-rename',
280
+ 'alias-attach',
281
+ 'alias-detach',
282
+ 'poweroff-migrate',
283
+ 'poweroff-hard-migrate',
284
+ 'backup',
285
+ 'nic-update',
286
+ 'backup-cancel',
287
+ 'sched-add',
288
+ 'sched-update',
289
+ 'sched-delete',
290
+ 'sg-attach',
291
+ 'sg-detach',
292
+ 'pci-attach',
293
+ 'pci-detach'
294
+ ]
233
295
 
234
296
  EXTERNAL_IP_ATTRS = [
235
297
  'GUEST_IP',
@@ -811,6 +873,24 @@ module OpenNebula
811
873
  @client.call(VM_METHODS[:backupcancel], @pe_id)
812
874
  end
813
875
 
876
+ # Attaches a PCI to a VM
877
+ #
878
+ # @param pci [String] Template containing a PCI element
879
+ # @return [nil, OpenNebula::Error] nil in case of success, Error
880
+ # otherwise
881
+ def pci_attach(pci)
882
+ call(VM_METHODS[:attachpci], @pe_id, pci)
883
+ end
884
+
885
+ # Detaches a PCI from a VM
886
+ #
887
+ # @param pci_id [Integer] Id of the PCI to be detached
888
+ # @return [nil, OpenNebula::Error] nil in case of success, Error
889
+ # otherwise
890
+ def pci_detach(pci_id)
891
+ call(VM_METHODS[:detachpci], @pe_id, pci_id)
892
+ end
893
+
814
894
  ########################################################################
815
895
  # Helpers to get VirtualMachine information
816
896
  ########################################################################
@@ -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.1'
82
+ VERSION = '6.8.3'
83
83
  end
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.1
4
+ version: 6.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: 2023-12-16 00:00:00.000000000 Z
11
+ date: 2024-04-21 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