Disable Naming/VariableName for propSpecs

I assume `propSpecs` is a reference to the VMWare API so using camelCase
is intentional.
This commit is contained in:
Brandon High 2020-03-05 11:50:56 -08:00
parent f85f5126e8
commit b4f42cd4b1
No known key found for this signature in database
GPG key ID: 270079C784FCAFDE

View file

@ -132,11 +132,11 @@ module Vmpooler
def get_folder_children(folder_name, connection) def get_folder_children(folder_name, connection)
folders = [] folders = []
propSpecs = { propSpecs = { # rubocop:disable Naming/VariableName
entity: self, entity: self,
inventoryPath: folder_name inventoryPath: folder_name
} }
folder_object = connection.searchIndex.FindByInventoryPath(propSpecs) folder_object = connection.searchIndex.FindByInventoryPath(propSpecs) # rubocop:disable Naming/VariableName
return folders if folder_object.nil? return folders if folder_object.nil?
@ -700,12 +700,12 @@ module Vmpooler
datacenter = get_target_datacenter_from_config(pool_name) datacenter = get_target_datacenter_from_config(pool_name)
return nil if datacenter.nil? return nil if datacenter.nil?
propSpecs = { propSpecs = { # rubocop:disable Naming/VariableName
entity: self, entity: self,
inventoryPath: "#{datacenter}/vm/#{folder}" inventoryPath: "#{datacenter}/vm/#{folder}"
} }
folder_object = connection.searchIndex.FindByInventoryPath(propSpecs) folder_object = connection.searchIndex.FindByInventoryPath(propSpecs) # rubocop:disable Naming/VariableName
return nil unless folder_object.class == RbVmomi::VIM::Folder return nil unless folder_object.class == RbVmomi::VIM::Folder
folder_object folder_object
@ -891,12 +891,12 @@ module Vmpooler
get_snapshot_list(vm.snapshot.rootSnapshotList, snapshotname) if vm.snapshot get_snapshot_list(vm.snapshot.rootSnapshotList, snapshotname) if vm.snapshot
end end
def build_propSpecs(datacenter, folder, vmname) def build_propSpecs(datacenter, folder, vmname) # rubocop:disable Naming/MethodName
propSpecs = { propSpecs = { # rubocop:disable Naming/VariableName
entity => self, entity => self,
:inventoryPath => "#{datacenter}/vm/#{folder}/#{vmname}" :inventoryPath => "#{datacenter}/vm/#{folder}/#{vmname}"
} }
propSpecs propSpecs # rubocop:disable Naming/VariableName
end end
def find_vm(pool_name, vmname, connection) def find_vm(pool_name, vmname, connection)
@ -909,12 +909,12 @@ module Vmpooler
datacenter = get_target_datacenter_from_config(pool_name) datacenter = get_target_datacenter_from_config(pool_name)
return nil if datacenter.nil? return nil if datacenter.nil?
propSpecs = { propSpecs = { # rubocop:disable Naming/VariableName
entity: self, entity: self,
inventoryPath: "#{datacenter}/vm/#{folder}/#{vmname}" inventoryPath: "#{datacenter}/vm/#{folder}/#{vmname}"
} }
connection.searchIndex.FindByInventoryPath(propSpecs) connection.searchIndex.FindByInventoryPath(propSpecs) # rubocop:disable Naming/VariableName
end end
def get_base_vm_container_from(connection) def get_base_vm_container_from(connection)
@ -1035,12 +1035,12 @@ module Vmpooler
datacenter = get_target_datacenter_from_config(pool['name']) datacenter = get_target_datacenter_from_config(pool['name'])
raise('cannot find datacenter') if datacenter.nil? raise('cannot find datacenter') if datacenter.nil?
propSpecs = { propSpecs = { # rubocop:disable Naming/VariableName
entity: self, entity: self,
inventoryPath: "#{datacenter}/vm/#{pool['template']}" inventoryPath: "#{datacenter}/vm/#{pool['template']}"
} }
template_vm_object = connection.searchIndex.FindByInventoryPath(propSpecs) template_vm_object = connection.searchIndex.FindByInventoryPath(propSpecs) # rubocop:disable Naming/VariableName
raise("Pool #{pool['name']} specifies a template VM of #{pool['template']} which does not exist for the provider #{name}") if template_vm_object.nil? raise("Pool #{pool['name']} specifies a template VM of #{pool['template']} which does not exist for the provider #{name}") if template_vm_object.nil?
template_vm_object template_vm_object