Zhou Zheng Sheng has posted comments on this change.

Change subject: fix TypeError of _eqSplit in vdsClient.py
......................................................................


Patch Set 4: I would prefer that you didn't submit this

(1 inline comment)

....................................................
File vdsm_cli/vdsClient.py
Line 1419:         for arg in args:
Line 1420:             kv = arg.split('=', 1)
Line 1421:             if len(kv) == 2:
Line 1422:                 k, v = kv
Line 1423:                 d[k] = v
Either
            kv = arg.split('=', 1)
            if len(kv) != 2:
                raise Exception("Unknown argument format: %s" % arg)
            k, v = kv
            d[k] = v

Or
            kv = arg.split('=', 1)
            k, v = kv
            d[k] = v

Or
            kv = arg.split('=', 1)
            if len(kv) == 2:
                "argument given as: Arg=blah"
                k, v = kv
            else:
                "argument given as: Arg"
                k, v = kv[0], ''
            d[k] = v

In the third case, we can write something in the commit message like "implement 
parsing arguments in both form 'X=Y' and just 'X'." However when I lookup the 
places where this function is called, I find that the caller rely on this 
function to report error when argument is given as "X", so I think the first 
two piece of code is more appropriate.
Line 1424:         return d
Line 1425: 
Line 1426:     def _splitDriveSpecItems(self, item):
Line 1427:         """


--
To view, visit http://gerrit.ovirt.org/7200
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I98b5573499adaa1b64f8343b445cc16df8f60f3d
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Bing Bu Cao <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Shu Ming <[email protected]>
Gerrit-Reviewer: Xu He Jie <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to