Juan Hernandez has posted comments on this change.
Change subject: BZ#770834 - Handle correctly nic names like p33p1
......................................................................
Patch Set 2: (1 inline comment)
....................................................
File vdsm/configNetwork.py
Line 133: nics_rexp = re.compile("^([A-Za-z]+)([0-9]+)$")
The original sed is using the $ anchor, like I did in python. Without that anchor the
regular expression matches only "p33".
Try it without the anchors:
python -c 'import re; s = re.compile("([A-Za-z]+)([0-9]+)"); m =
s.match("p33p1"); print(m.group(1));'
python -c 'import re; s = re.compile("([A-Za-z]+)([0-9]+)"); m =
s.match("p33p1"); print(m.group(2));'
This gives "p" and "33". The "p1" part is gone.
With the anchors it will not match, and that is exactly what I wanted. That way in the
loop the complete nic name is added back to the list.
The solution is not perfect, but it is better than what we have now.
--
To view, visit
http://gerrit.ovirt.org/799
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I716f5d7d137325abaa0022a40f482c9ad270855a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>