Alon Bar-Lev has uploaded a new change for review.
Change subject: cleanup: do not use external program ipcalc for ip validation ......................................................................
cleanup: do not use external program ipcalc for ip validation
IPv4 addresses are simple to parse and validate. No need to execute external process for the task.
Especially if process is not supported by all platforms, and it has no added value.
$ ipcalc -c -4 0.0.0.0 && echo ok ok $ ipcalc -c -4 255.255.255.255 && echo ok ok $ ipcalc -c -m -4 1.1.1.1 && echo ok ok
Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Signed-off-by: Alon Bar-Lev alonbl@redhat.com --- M vdsm/configNetwork.py 1 file changed, 16 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/6929/1 -- To view, visit http://gerrit.ovirt.org/6929 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: cleanup: do not use external program ipcalc for ip validation ......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
Thanks, Alon. I think you should clean configure.ac, too.
.................................................... File vdsm/configNetwork.py Line 469: ret = False ret is unused
Line 477: except: we use except with no qualifications quite often, but it is quite evil. I suppose you care only for the ValueError of int(). If so, please limit the catch-all expcet, and the size of the try block.
-- To view, visit http://gerrit.ovirt.org/6929 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com
Alon Bar-Lev has posted comments on this change.
Change subject: cleanup: do not use external program ipcalc for ip validation ......................................................................
Patch Set 1: (2 inline comments)
.................................................... File vdsm/configNetwork.py Line 469: ret = False Done
Line 477: except: I thought of any other case which may fail this... are you sure you want a specific error?
-- To view, visit http://gerrit.ovirt.org/6929 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: cleanup: do not use external program ipcalc for ip validation ......................................................................
Patch Set 2: I would prefer that you didn't submit this
Thanks, but EX_IPCALC should be dropped now.
-- To view, visit http://gerrit.ovirt.org/6929 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com
Alon Bar-Lev has posted comments on this change.
Change subject: cleanup: do not use external program ipcalc for ip validation ......................................................................
Patch Set 3:
Remove ipcalc dependency from build.
Sorry for missing this.
-- To view, visit http://gerrit.ovirt.org/6929 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: cleanup: do not use external program ipcalc for ip validation ......................................................................
Patch Set 3: Looks good to me, approved
Thanks!
-- To view, visit http://gerrit.ovirt.org/6929 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com
Alon Bar-Lev has posted comments on this change.
Change subject: cleanup: do not use external program ipcalc for ip validation ......................................................................
Patch Set 3: Verified
-- To view, visit http://gerrit.ovirt.org/6929 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com
Dan Kenigsberg has submitted this change and it was merged.
Change subject: cleanup: do not use external program ipcalc for ip validation ......................................................................
cleanup: do not use external program ipcalc for ip validation
IPv4 addresses are simple to parse and validate. No need to execute external process for the task.
Especially if process is not supported by all platforms, and it has no added value.
$ ipcalc -c -4 0.0.0.0 && echo ok ok $ ipcalc -c -4 255.255.255.255 && echo ok ok $ ipcalc -c -m -4 1.1.1.1 && echo ok ok
Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Signed-off-by: Alon Bar-Lev alonbl@redhat.com --- M configure.ac M vdsm/configNetwork.py M vdsm/constants.py.in 3 files changed, 15 insertions(+), 17 deletions(-)
Approvals: Alon Bar-Lev: Verified Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/6929 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Ia7d5a6515591147cfc86c9279f69da44f94a9872 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com
vdsm-patches@lists.fedorahosted.org