mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
netlink: adding ifacename name at the beginning of log info msg
Ticket: None Reviewed By: Roopa Testing Done: Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
@ -20,17 +20,18 @@ class Netlink(utilsBase):
|
||||
self._nlmanager_api = NetlinkManager()
|
||||
|
||||
def get_iface_index(self, ifacename):
|
||||
self.logger.info('netlink: %s: get iface index' % ifacename)
|
||||
self.logger.info('%s: netlink: %s: get iface index'
|
||||
% (ifacename, ifacename))
|
||||
if ifupdownflags.flags.DRYRUN: return
|
||||
try:
|
||||
return self._nlmanager_api.get_iface_index(ifacename)
|
||||
except Exception as e:
|
||||
raise Exception('netlink: %s: cannot get ifindex: %s'
|
||||
% (ifacename, str(e)))
|
||||
raise Exception('%s: netlink: %s: cannot get ifindex: %s'
|
||||
% (ifacename, ifacename, str(e)))
|
||||
|
||||
def link_add_vlan(self, vlanrawdevice, ifacename, vlanid):
|
||||
self.logger.info('netlink: ip link add link %s name %s type vlan id %s'
|
||||
% (vlanrawdevice, ifacename, vlanid))
|
||||
self.logger.info('%s: netlink: ip link add link %s name %s type vlan id %s'
|
||||
% (ifacename, vlanrawdevice, ifacename, vlanid))
|
||||
if ifupdownflags.flags.DRYRUN: return
|
||||
ifindex = self.get_iface_index(vlanrawdevice)
|
||||
try:
|
||||
@ -40,8 +41,8 @@ class Netlink(utilsBase):
|
||||
% (vlanrawdevice, vlanid, str(e)))
|
||||
|
||||
def link_add_macvlan(self, ifacename, macvlan_ifacename):
|
||||
self.logger.info('netlink: ip link add link %s name %s type macvlan mode private'
|
||||
% (ifacename, macvlan_ifacename))
|
||||
self.logger.info('%s: netlink: ip link add link %s name %s type macvlan mode private'
|
||||
% (ifacename, ifacename, macvlan_ifacename))
|
||||
if ifupdownflags.flags.DRYRUN: return
|
||||
ifindex = self.get_iface_index(ifacename)
|
||||
try:
|
||||
@ -51,7 +52,8 @@ class Netlink(utilsBase):
|
||||
% (ifacename, macvlan_ifacename, str(e)))
|
||||
|
||||
def link_set_updown(self, ifacename, state):
|
||||
self.logger.info('netlink: ip link set dev %s %s' % (ifacename, state))
|
||||
self.logger.info('%s: netlink: ip link set dev %s %s'
|
||||
% (ifacename, ifacename, state))
|
||||
if ifupdownflags.flags.DRYRUN: return
|
||||
try:
|
||||
return self._nlmanager_api.link_set_updown(ifacename, state)
|
||||
@ -60,7 +62,8 @@ class Netlink(utilsBase):
|
||||
% (ifacename, state, str(e)))
|
||||
|
||||
def link_set_protodown(self, ifacename, state):
|
||||
self.logger.info('netlink: set link %s protodown %s' % (ifacename, state))
|
||||
self.logger.info('%s: netlink: set link %s protodown %s'
|
||||
% (ifacename, ifacename, state))
|
||||
if ifupdownflags.flags.DRYRUN: return
|
||||
try:
|
||||
return self._nlmanager_api.link_set_protodown(ifacename, state)
|
||||
@ -69,8 +72,8 @@ class Netlink(utilsBase):
|
||||
% (ifacename, state, str(e)))
|
||||
|
||||
def link_add_bridge_vlan(self, ifacename, vlanid):
|
||||
self.logger.info('netlink: bridge vlan add vid %s dev %s'
|
||||
% (vlanid, ifacename))
|
||||
self.logger.info('%s: netlink: bridge vlan add vid %s dev %s'
|
||||
% (ifacename, vlanid, ifacename))
|
||||
if ifupdownflags.flags.DRYRUN: return
|
||||
ifindex = self.get_iface_index(ifacename)
|
||||
try:
|
||||
@ -80,8 +83,8 @@ class Netlink(utilsBase):
|
||||
% (ifacename, vlanid, str(e)))
|
||||
|
||||
def link_del_bridge_vlan(self, ifacename, vlanid):
|
||||
self.logger.info('netlink: bridge vlan del vid %s dev %s'
|
||||
% (vlanid, ifacename))
|
||||
self.logger.info('%s: netlink: bridge vlan del vid %s dev %s'
|
||||
% (ifacename, vlanid, ifacename))
|
||||
if ifupdownflags.flags.DRYRUN: return
|
||||
ifindex = self.get_iface_index(ifacename)
|
||||
try:
|
||||
@ -99,7 +102,7 @@ class Netlink(utilsBase):
|
||||
cmd += ' ageing %s' % ageing if ageing else ''
|
||||
cmd += ' remote %s' % group if group else ' noremote'
|
||||
cmd += ' nolearning' if learning == 'off' else ''
|
||||
self.logger.info('netlink: %s' % cmd)
|
||||
self.logger.info('%s: netlink: %s' % (ifacename, cmd))
|
||||
if ifupdownflags.flags.DRYRUN: return
|
||||
try:
|
||||
return self._nlmanager_api.link_add_vxlan(ifacename,
|
||||
|
Reference in New Issue
Block a user