]> git.proxmox.com Git - mirror_ifupdown2.git/commit - addons/vrf.py
addons: vrf: removing ifaceobj.name from exception message
authorJulien Fortin <julien@cumulusnetworks.com>
Tue, 4 Oct 2016 08:13:23 +0000 (10:13 +0200)
committerJulien Fortin <julien@cumulusnetworks.com>
Tue, 4 Oct 2016 08:13:23 +0000 (10:13 +0200)
commit9b35cb3e191d362960866e286a29009159de7d60
tree2207d34d433b41a507a2e5aae311c1d6083652a3
parentb6b8bd2b773f5bb9433052ae6be037e65ab6c423
addons: vrf: removing ifaceobj.name from exception message

Ticket: None
Reviewed By:
Testing Done:

The function _create_vrf_dev is surrounded by a try/catch as follow:
    try:
        vrf_table = self._create_vrf_dev(ifaceobj, vrf_table)
    except Exception, e:
        self.log_error('%s: %s' %(ifaceobj.name, str(e)), ifaceobj)

Thus we shouldn't include the ifaceobj.name in any error message passed to
log_error(). Since this function will raise an exception by default, it will
result in something like this:

error:br0.4002: red: red: create failed (cmd 'ip link add name red type vrf table 1001' failed: returned 1 ...[snip]
error:red: red: create failed (cmd 'ip link add name red type vrf table 1002' failed: returned 1 ...[snip]

after this patch:
error: red: create failed (cmd 'ip link add name red type vrf table 1002' failed: returned 1 ... [snip]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
addons/vrf.py