Nir Soffer has posted comments on this change.
Change subject: Get rid of mutables(lists) as default parameters
......................................................................
Patch Set 4: -Code-Review
(1 comment)
Do not copy example code from gerrit comments, it usually does not work :-)
....................................................
File vdsm/storage/misc.py
Line 132: file name, line number and function name.
Line 133: """
Line 134: # Ignore file extension can be either py or pyc
Line 135: ignoreSourceFiles = [os.path.splitext(sf)[0] for sf in
Line 136: ignoreSourceFiles + (logging._srcfile,)]
This breaks when someone actually send a list of files here. The old was also
broken if someone sent a tuple or an iterator.
The best way to handle this is to support any iteratable and use chain():
from itertools import chain
....
ignoreSourceFiles = [os.path.splitext(sf)[0] for sf in
chain(ignoreSourceFiles, [logging._srcfile]]
Line 137: frame = inspect.currentframe().f_back
Line 138:
Line 139: result = "(unknown file)", 0, "(unknown function)"
Line 140: # pop frames until you find an unfiltered one
--
To view, visit http://gerrit.ovirt.org/18356
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I911485cf30d587f5b6b8bf44cf3552c1517abfd5
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Better Saggi <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Giuseppe Vallarelli <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches