Alon Bar-Lev has posted comments on this change.

Change subject: packaging: stricter FQDN validation
......................................................................


Patch Set 1: (1 inline comment)

....................................................
File packaging/fedora/setup/common_utils.py
Line 632:                 else:
Line 633:                     isLoopback = False
Line 634:             foundIp = ipaddrPattern.search(line)
Line 635:             if foundIp is not None and not isLoopback:
Line 636:                 ipAddr = foundIp.group(1)
So best to maintain two entities in one pass:

1. interfaces = [list] # non loopback

2. addresses[interface] = [list]

A simple loop to construct the above two dictionaries based of two regular 
expressions, then:
 
 x = []
 for i in interfaces:
     x.extend(addresses[i])

Maybe cleaner is to hold all interfaces in dictionary:

 x = []
 for interface, loopback in interfaces.iteritems():
     if not loopback:
         x.extend(addresses(interface))

What I mean is that it might be clearer to read if the parsing is separated 
from the logic.
Line 637:                 logging.debug("Found IP Address: %s"%(ipAddr))
Line 638:                 iplist.add(ipAddr)
Line 639:         return iplist
Line 640:     except:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I512446c80dfa9c83adb179a445bfae82736d403f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Moran Goldboim <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to