Sergey Gotliv has posted comments on this change.
Change subject: Refactor getFilelist()
......................................................................
Patch Set 4:
(12 comments)
....................................................
Commit Message
Line 3: AuthorDate: 2013-10-23 23:36:03 +0300
Line 4: Commit: Sergey Gotliv <sgotliv(a)redhat.com>
Line 5: CommitDate: 2013-10-26 15:18:52 +0300
Line 6:
Line 7: Refactor getFilelist()
Done
Line 8:
Line 9: 1. Rename to getFileStats()
Line 10:
Line 11: New name getFileStats() better describes the essence of that API. This
Line 10:
Line 11: New name getFileStats() better describes the essence of that API. This
Line 12: is safe to rename it now because this API is not in use.
Line 13:
Line 14: 2. Allow to perform case incesitive search
Done
Line 15:
Line 16: Currently Engine is using getIsoList() and getFloppyList() APIs to
Line 17: retrieve the list of iso and floppy files respectively. Both these APIs
Line 18: are working in case incensitive manner but don't provide file
Line 15:
Line 16: Currently Engine is using getIsoList() and getFloppyList() APIs to
Line 17: retrieve the list of iso and floppy files respectively. Both these APIs
Line 18: are working in case incensitive manner but don't provide file
Line 19: statistics.
Done
Line 20: getFileList() is currently not used. It returns file statistics but
Line 21: uses case sensitive search. Using case insensitive search
Line 22: allow using getFileList() instead of getIsoList() and getFloppyList().
Line 23:
Line 18: are working in case incensitive manner but don't provide file
Line 19: statistics.
Line 20: getFileList() is currently not used. It returns file statistics but
Line 21: uses case sensitive search. Using case insensitive search
Line 22: allow using getFileList() instead of getIsoList() and getFloppyList().
Done
Line 23:
Line 24: 3. Rename return value and exception to reflect the change of the API
Line 25: name.
Line 26:
Line 21: uses case sensitive search. Using case insensitive search
Line 22: allow using getFileList() instead of getIsoList() and getFloppyList().
Line 23:
Line 24: 3. Rename return value and exception to reflect the change of the API
Line 25: name.
Yes. CaseSensitive is obvious either. :-)
Line 26:
Line 27: Change-Id: I550827c7b4c7e11fe09e41745fcc9d91249c6c23
Line 28: Bug-Url:
https://bugzilla.redhat.com/1005889
....................................................
File vdsm/BindingXMLRPC.py
Line 476: domain = API.StorageDomain(sdUUID)
Line 477: return domain.format(autoDetach)
Line 478:
Line 479: def domainGetFileStats(self, sdUUID, pattern='*',
Line 480: caseSensitive=True, options=None):
Done
Line 481: domain = API.StorageDomain(sdUUID)
Line 482: return domain.getFileStats(pattern, caseSensitive)
Line 483:
Line 484: def domainGetImages(self, sdUUID, options=None):
....................................................
File vdsm/storage/hsm.py
Line 2225: return self.taskMng.revertTask(taskID=taskID)
Line 2226:
Line 2227: @public
Line 2228: def getFileStats(self, sdUUID, pattern='*', caseSensitive=True,
Line 2229: options=None):
There is a match. Now it true, I'll change it to false.
Line 2230: """
Line 2231: Returns statistics of all files in the domain filtered according to
Line 2232: pattern.
Line 2233:
Line 2234: :param sdUUID: The UUID of the storage domain you want to query.
Line 2235: :type sdUUID: UUID
Line 2236: :param pattern: The glob expression for filtering.
Line 2237: :type pattern: str
Line 2238: :param caseSensitive: Controls the case of the matching.
I think this is so obvious that doesn't need any explanation.
This is explanation of IGNORECASE flag in re.py
"I IGNORECASE Perform case-insensitive matching."
This is from javadoc:
public static final int CASE_INSENSITIVE
Enables case-insensitive matching.
Let's see, without these explanations above I would never guess what IGNORECASE
means.
I will align my explanation with those abobe, but if you'll provide something better,
I'll take it.
Line 2239: :type caseSensitive: bool
Line 2240: :options: ?
Line 2241:
Line 2242: :returns: a dict of all the volumes found.
Line 2238: :param caseSensitive: Controls the case of the matching.
Line 2239: :type caseSensitive: bool
Line 2240: :options: ?
Line 2241:
Line 2242: :returns: a dict of all the volumes found.
Done
Line 2243: :rtype: dict
Line 2244: """
Line 2245: vars.task.setDefaultException(se.GetFileStatsError(sdUUID))
Line 2246: vars.task.getSharedLock(STORAGE, sdUUID)
Line 2249: if not dom.isISO or dom.getStorageType() != sd.NFS_DOMAIN:
Line 2250: raise se.GetFileStatsError(sdUUID)
Line 2251:
Line 2252: filesDict = dom.getFileList(pattern=pattern,
Line 2253: caseSensitive=caseSensitive)
Done
Line 2254: return {'fileStats': filesDict}
Line 2255:
Line 2256: @public
Line 2257: def getIsoList(self, spUUID, extension='iso', options=None):
....................................................
File vdsm/storage/storage_exception.py
Line 606:
Line 607:
Line 608: class GetFileStatsError(StorageException):
Line 609: code = 330
Line 610: message = "Cannot get files stats"
Done
Line 611:
Line 612:
Line 613: #################################################
Line 614: # Domains Exceptions
....................................................
File vdsm_api/vdsmapi-schema.json
Line 3840: # @storagedomainID: The UUID of the Storage Domain
Line 3841: #
Line 3842: # @pattern: Filter results by this glob pattern
Line 3843: #
Line 3844: # @caseSensitive: Controls the case of the matching
Its the same explanation as in the docstring.
Line 3845: #
Line 3846: # Returns:
Line 3847: # A dictionary of file information indexed by file name
Line 3848: #
--
To view, visit
http://gerrit.ovirt.org/20476
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I550827c7b4c7e11fe09e41745fcc9d91249c6c23
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <sgotliv(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgotliv(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes