Ido Barkan has uploaded a new change for review. Change subject: better error reporting when configuring source routing ......................................................................
better error reporting when configuring source routing Change-Id: I09337470478aa73c8aa06ec129d0105b5f93bb64 Signed-off-by: ibarkan <ibar...@redhat.com> --- M vdsm/network/configurators/__init__.py 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/33812/1 diff --git a/vdsm/network/configurators/__init__.py b/vdsm/network/configurators/__init__.py index 72b66d8..27ca4be 100644 --- a/vdsm/network/configurators/__init__.py +++ b/vdsm/network/configurators/__init__.py @@ -124,10 +124,18 @@ ip = netEnt.ipConfig # bootproto is None for both static and no bootproto if ip.bootproto != 'dhcp' and netEnt.master is None: - logging.debug("Adding source route %s, %s, %s, %s" % - (netEnt.name, ip.ipaddr, ip.netmask, ip.gateway)) - StaticSourceRoute(netEnt.name, self).\ - configure(ip.ipaddr, ip.netmask, ip.gateway) + logging.debug("Adding source route: name=%s, addr=%s, netmask=%s, " + "gateway=%s" % (netEnt.name, ip.ipaddr, ip.netmask, + ip.gateway)) + if (ip.gateway in (None, '0.0.0.0') + or not ip.ipaddr or not ip.netmask): + logging.error('invalid input for source routing: name=%s, ' + 'addr=%s, netmask=%s, gateway=%s', + netEnt.name, ip.ipaddr, ip.netmask, + ip.gateway) + else: + StaticSourceRoute(netEnt.name, self).\ + configure(ip.ipaddr, ip.netmask, ip.gateway) def _removeSourceRoute(self, netEnt, sourceRouteClass): if netEnt.ipConfig.bootproto != 'dhcp' and netEnt.master is None: -- To view, visit http://gerrit.ovirt.org/33812 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09337470478aa73c8aa06ec129d0105b5f93bb64 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ido Barkan <ibar...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches