Change in vdsm[master]: refactoring: rename variable in getVlanID function

wudxw at linux.vnet.ibm.com wudxw at linux.vnet.ibm.com
Fri Aug 9 01:34:33 UTC 2013


Mark Wu has posted comments on this change.

Change subject: refactoring: rename variable in getVlanID function
......................................................................


Patch Set 1:

(1 comment)

I agree with that id is not a good variable name in python, but it's also ok because we it's just a local temp variable and builtin function id is less used in our code.

BTW,  would you like to fix the other similar usages?
./vdsm/storage/task.py:            id = str(uuid.uuid4())
./vdsm/storage/storage_mailbox.py:                        id = str(uuid.uuid4())
./vdsm/storage/storage_mailbox.py:                        id = str(uuid.uuid4())

./client/vdsClient.py:        file = self._parseDriveSpec(args[1])
./client/vdsClient.py:        file = self._parseDriveSpec(args[1])
./vdsm/storage/sp.py:        file = open(self._poolFile, "r")

./tests/miscTests.py:        dir = tempfile.mkdtemp()
./tests/miscTests.py:        dir = tempfile.mkdtemp()
./tests/hooksTests.py:        dir = tempfile.mkdtemp()

....................................................
File lib/vdsm/netinfo.py
Line 547: 
Line 548: 
Line 549: def getVlanID(vlan):
Line 550:     """ Return the ID of the given VLAN. """
Line 551:     idVlan = None
Anyway,  vlanID should be a better name than idVlan.
Line 552: 
Line 553:     if os.path.exists(PROC_NET_VLAN):
Line 554:         for line in file(PROC_NET_VLAN + vlan).readlines():
Line 555:             if "VID" in line:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I16f28ea07c3ba0a704a094f0fa08d4e03b07a9dc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list