1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-25 02:50:08 +03:00

M #-: Don't use unpack1 (#457)

This commit is contained in:
Jan Orel 2020-11-20 15:34:39 +01:00 committed by GitHub
parent d53f0a3d90
commit 6d4810de49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -730,6 +730,9 @@ Style/LineEndConcatenation:
Style/MultilineIfModifier:
Enabled: False
Style/UnpackFirst:
Enabled: False
######
# LINT
######

View File

@ -697,7 +697,7 @@ class ExecDriver < VirtualMachineDriver
target_xpath = "VM/TEMPLATE/DISK[ATTACH='YES']/TARGET"
target = ensure_xpath(xml_data, id, action, target_xpath) || return
target_index = target.downcase[-1..-1].unpack1('c') - 97
target_index = target.downcase[-1..-1].unpack('c').first - 97
action = VmmAction.new(self, id, :attach_disk, drv_message)
@ -744,7 +744,7 @@ class ExecDriver < VirtualMachineDriver
target_xpath = "VM/TEMPLATE/DISK[ATTACH='YES']/TARGET"
target = ensure_xpath(xml_data, id, action, target_xpath) || return
target_index = target.downcase[-1..-1].unpack1('c') - 97
target_index = target.downcase[-1..-1].unpack('c').first - 97
action = VmmAction.new(self, id, :detach_disk, drv_message)
@ -1361,7 +1361,7 @@ end
#
################################################################################
ENV_CONF = Hash.new("").merge!(ENV)
ENV_CONF = Hash.new('').merge!(ENV)
LIVE_DISK_SNAPSHOTS = ENV_CONF['LIVE_DISK_SNAPSHOTS'].split
VNMAD_LOCAL_ACTIONS = ENV_CONF['VNMAD_LOCAL_ACTIONS'].split