lib/vmpooler/providers/vsphere.rb
def find_template_vm(pool, connection)
          datacenter = get_target_datacenter_from_config(pool['name'])
          raise('cannot find datacenter') if datacenter.nil?

          propSpecs = { # rubocop:disable Naming/VariableName
            entity: self,
            inventoryPath: "#{datacenter}/vm/#{pool['template']}"
          }

          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?

          template_vm_object
        end
# The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
def find_template_vm(pool, connection)
          datacenter = get_target_datacenter_from_config(pool['name'])
          raise('cannot find datacenter') if datacenter.nil?
          propSpecs = { 
            entity: self,
            inventoryPath: "#{datacenter}/vm/#{pool['template']}"
          }
          template_vm_object = connection.searchIndex.FindByInventoryPath(propSpecs) 
          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
        end
def find_template_vm ( pool , connection ) datacenter = get_target_datacenter_from_config ( pool [ 'name' ] ) raise ( 'cannot find datacenter' ) if datacenter . nil? propSpecs = { entity : self , inventoryPath : "#{datacenter}/vm/#{pool['template']}" } template_vm_object = connection . searchIndex . FindByInventoryPath ( propSpecs ) 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 end
The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
# rubocop:disable Naming/VariableName # rubocop:disable Naming/VariableName
pool
connection