(GH-213) Remove use of private _connection method

Previosuly in find_vmdks in vsphere_helper it uses the call
vmdk_datastore._connection to get the underlying connection, however this is
already available as function parameter.  This commit removes this bad code and
the associated test fixtures.
This commit is contained in:
Glenn Sarti 2017-06-15 13:45:14 -07:00
parent ee3f5e2215
commit 3a4df791ff
2 changed files with 1 additions and 22 deletions

View file

@ -674,7 +674,7 @@ module Vmpooler
vmdk_datastore = find_datastore(datastore, connection)
vm_files = vmdk_datastore._connection.serviceContent.propertyCollector.collectMultiple vmdk_datastore.vm, 'layoutEx.file'
vm_files = connection.serviceContent.propertyCollector.collectMultiple vmdk_datastore.vm, 'layoutEx.file'
vm_files.keys.each do |f|
vm_files[f]['layoutEx.file'].each do |l|
if l.name =~ /^\[#{vmdk_datastore.name}\] #{vmname}\/#{vmname}_([0-9]+).vmdk/