Alon Bar-Lev has posted comments on this change.
Change subject: packaging: stricter FQDN validation
......................................................................
Patch Set 2: (1 inline comment)
....................................................
File packaging/fedora/setup/common_utils.py
Line 628: addresses[currentDevice] = []
Line 629: else:
Line 630: foundIp = ipaddrPattern.search(line)
Line 631: if foundIp is not None:
Line 632: addresses[currentDevice].append(foundIp.group(1))
I am so sorry!!! let me know when to stop...
For each line we detect, can be address or device there is interface name,
there is no need to store context....
I was thinking of something like:
addresses = {}
interfaces = {}
for line in output.splitlines():
interfacematch = interfacere.match(line)
addressmatch = addressre.match(line):
if interfacematch is not None:
interfaces[interfacematch.group('interface')] = \
'LOOPBACK' in interfacematch.group('options')
elif addressmatch is not None:
addresses.setdefault(
addressmatch.group('interface'),
[]
).append(addressmatch.group('address'))
These are two independent parsers going over the output, each building its own
data structure.
Line 633: except Exception:
Line 634: logging.error(traceback.format_exc())
Line 635: raise Exception(output_messages.ERR_EXP_GET_CFG_IPS)
Line 636:
--
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: 2
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: 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