Nir Soffer has posted comments on this change.

Change subject: Get rid of mutables(lists) as default parameters
......................................................................


Patch Set 2:

(3 comments)

Some changes can be simplified.

....................................................
File vdsm/gluster/exception.py
Line 37:     code = 4100
Line 38:     message = "Gluster Exception"
Line 39:     rc = 0
Line 40:     out = []
Line 41:     err = []
out and err can be empty tuples. Can be handled in another patch.
Line 42: 
Line 43:     def __init__(self, rc=0, out=None, err=None):
Line 44:         self.rc = rc
Line 45:         self.out = [] if out is None else out


Line 39:     rc = 0
Line 40:     out = []
Line 41:     err = []
Line 42: 
Line 43:     def __init__(self, rc=0, out=None, err=None):
If class out and error are empty tuples, then arguments can be the same, 
simplifying the assignment bellow.
Line 44:         self.rc = rc
Line 45:         self.out = [] if out is None else out
Line 46:         self.err = [] if err is None else err
Line 47: 


....................................................
File vdsm/storage/misc.py
Line 145:         filename = os.path.normcase(code.co_filename)
Line 146: 
Line 147:         logSkip = _shouldLogSkip(
Line 148:             skipUp, ignoreSourceFiles,
Line 149:             [] if ignoreMethodNames is None else ignoreMethodNames,
_shouldLogSkip() is expecting an iteratable, tuple would be fine.
Line 150:             logSkipName, code, filename)
Line 151: 
Line 152:         if logSkip:
Line 153:             skipUp -= 1


-- 
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: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegu...@redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com>
Gerrit-Reviewer: Better Saggi <bettersa...@gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvall...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizr...@redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeen...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to