1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-01 05:47:01 +03:00

L #-: Adjust for new rubocop version

(cherry picked from commit 2eeea9b80ba896d0b293c49000c93b84e5558b68)
This commit is contained in:
Tino Vázquez 2023-02-23 19:14:08 +01:00
parent b369372f62
commit 828d3b38c3
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -208,6 +208,7 @@ class LXCVM < OpenNebulaVM
@xml.elements('//TEMPLATE/DISK').each do |xml|
next if xml['TYPE'].downcase == 'swap'
# rubocop:disable Style/ConditionalAssignment
if xml['DISK_ID'] == @rootfs_id
adisks << Disk.new_root(xml, @sysds_path, @vm_id,
@lxcrc[:mountopts])
@ -215,6 +216,7 @@ class LXCVM < OpenNebulaVM
adisks << Disk.new_disk(xml, @sysds_path, @vm_id,
@lxcrc[:mountopts])
end
# rubocop:enable Style/ConditionalAssignment
end
context_xml = @xml.element('//TEMPLATE/CONTEXT')
@ -271,11 +273,13 @@ class LXCVM < OpenNebulaVM
key = match[1].strip
value = match[2].strip
# rubocop:disable Style/ConditionalAssignment
if !raw_map[key].nil?
raw_map[key] = value
else
raw_map[key] = Array(raw_map[key]) << value
end
# rubocop:enable Style/ConditionalAssignment
end
rescue StandardError
end