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

L #-: Several linting fixes

This commit is contained in:
Tino Vázquez 2022-10-10 18:43:38 +02:00
parent 015c66e1a9
commit 6ba27387bc
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 9 additions and 11 deletions

View File

@ -222,11 +222,11 @@ module VirtualMachineManagerKVM
# NOTE: On detach (as we are manging MAC/VLAN through ip link vf) devices
# needs to use <hostdev> format
#-----------------------------------------------------------------------
def hostdev_xml(_opts = {})
def hostdev_xml(defined_opts = {})
opts = {
:force_hostdev => false,
:pci => false
}.merge(_opts)
:force_hostdev => false,
:pci => false
}.merge(defined_opts)
prefix_old = @xpath_prefix
@xpath_prefix = "TEMPLATE/PCI[ATTACH='YES']/"
@ -258,11 +258,9 @@ module VirtualMachineManagerKVM
dev << xputs(' function=%s', 'FUNCTION', :hex => true)
dev << '/></source>'
#Setting Bus address needs to check that a PCI contoller is
#present for Bus 1
vm_addr = %w[VM_DOMAIN VM_BUS VM_SLOT VM_FUNCTION].all? {|e|
exist? e
}
# Setting Bus address needs to check that a PCI contoller is
# present for Bus 1
vm_addr = %w[VM_DOMAIN VM_BUS VM_SLOT VM_FUNCTION].all? {|e| exist? e }
if vm_addr && opts[:pci]
dev << '<address type="pci"'

View File

@ -112,9 +112,9 @@ module VNMMAD::VirtualFunction
def on_off(option)
if option.match(/^yes$|^on$/i)
"on"
'on'
else
"off"
'off'
end
end