def find_dvs_by_path(self,si ,path):
        """
        Finds vm in the vCenter or returns "None"
        :param si:         pyvmomi 'ServiceInstance'
        :param path:       the path to find the object ('dc' or 'dc/folder' or 'dc/folder/folder/etc...')
        """
        dvs = self.get_folder(si, path)

        if not dvs:
            raise ValueError('Could not find Default DvSwitch in path {0}'.format(path))
        elif not isinstance(dvs, vim.dvs.VmwareDistributedVirtualSwitch):
            raise ValueError('The object in path {0} is {1} and not a DvSwitch'.format(path, type(dvs)))

        return dvs
def find_dvs_by_path ( self , si , path ) : dvs = self . get_folder ( si , path ) if not dvs : raise ValueError ( 'Could not find Default DvSwitch in path {0}' . format ( path ) ) elif not isinstance ( dvs , vim . dvs . VmwareDistributedVirtualSwitch ) : raise ValueError ( 'The object in path {0} is {1} and not a DvSwitch' . format ( path , type ( dvs ) ) ) return dvs
Finds vm in the vCenter or returns "None"
        :param si:         pyvmomi 'ServiceInstance'
        :param path:       the path to find the object ('dc' or 'dc/folder' or 'dc/folder/folder/etc...')