python 3: Replace deprecated logging.warn with logging.warning
logging.warn is deprecated in Python 3 [1]. This patch switches it to the non-deprecated logging.warning. This is bug-reported by openstack [2]. [1] https://docs.python.org/3/library/logging.html#logging.warning [2] https://bugs.launchpad.net/magnum/+bug/1508442 Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
f86499373a
commit
9f4328682f
@ -49,8 +49,8 @@ class MacToNetwork(object):
|
||||
# VM-> tap-> ovs-> ext-port-> wire-> ext-port-> ovs-> tap-> VM
|
||||
return
|
||||
|
||||
LOG.warn('duplicated nw_id: mac %s nw old %s new %s',
|
||||
haddr_to_str(mac), _nw_id, nw_id)
|
||||
LOG.warning('duplicated nw_id: mac %s nw old %s new %s',
|
||||
haddr_to_str(mac), _nw_id, nw_id)
|
||||
|
||||
raise MacAddressDuplicated(mac=mac)
|
||||
|
||||
|
@ -325,7 +325,8 @@ class VSCtlContext(object):
|
||||
for ovsrec_bridge in ovsrec_bridges.rows.values():
|
||||
name = ovsrec_bridge.name
|
||||
if name in bridges:
|
||||
LOG.warn('%s: database contains duplicate bridge name', name)
|
||||
LOG.warning('%s: database contains duplicate bridge name',
|
||||
name)
|
||||
bridges.add(name)
|
||||
vsctl_bridge = self.add_bridge_to_cache(ovsrec_bridge, name,
|
||||
None, 0)
|
||||
@ -356,10 +357,10 @@ class VSCtlContext(object):
|
||||
vsctl_port = self.ports.get(port_name)
|
||||
if vsctl_port:
|
||||
if ovsrec_port == vsctl_port.port_cfg:
|
||||
LOG.warn('%s: vsctl_port is in multiple bridges '
|
||||
'(%s and %s)',
|
||||
port_name, vsctl_bridge.name,
|
||||
vsctl_port.br.name)
|
||||
LOG.warning('%s: vsctl_port is in multiple bridges '
|
||||
'(%s and %s)',
|
||||
port_name, vsctl_bridge.name,
|
||||
vsctl_port.br.name)
|
||||
else:
|
||||
LOG.error('%s: database contains duplicate '
|
||||
'vsctl_port name',
|
||||
@ -378,7 +379,7 @@ class VSCtlContext(object):
|
||||
iface = self.ifaces.get(ovsrec_iface.name)
|
||||
if iface:
|
||||
if ovsrec_iface == iface.iface_cfg:
|
||||
LOG.warn(
|
||||
LOG.warning(
|
||||
'%s: interface is in multiple ports '
|
||||
'(%s and %s)',
|
||||
ovsrec_iface.name,
|
||||
|
@ -472,7 +472,8 @@ class CoreService(Factory, Activity):
|
||||
if (host, port) in self.bmpclients:
|
||||
bmpclient = self.bmpclients[(host, port)]
|
||||
if bmpclient.started:
|
||||
LOG.warn("bmpclient is already running for %s:%s", host, port)
|
||||
LOG.warning("bmpclient is already running for %s:%s",
|
||||
host, port)
|
||||
return False
|
||||
bmpclient = BMPClient(self, host, port)
|
||||
self.bmpclients[(host, port)] = bmpclient
|
||||
@ -481,7 +482,7 @@ class CoreService(Factory, Activity):
|
||||
|
||||
def stop_bmp(self, host, port):
|
||||
if (host, port) not in self.bmpclients:
|
||||
LOG.warn("no bmpclient is running for %s:%s", host, port)
|
||||
LOG.warning("no bmpclient is running for %s:%s", host, port)
|
||||
return False
|
||||
|
||||
bmpclient = self.bmpclients[(host, port)]
|
||||
|
@ -283,26 +283,27 @@ class VRRPRouter(app_manager.RyuApp):
|
||||
class VRRPV2StateInitialize(VRRPState):
|
||||
# In theory this shouldn't be called.
|
||||
def master_down(self, ev):
|
||||
self.vrrp_router.logger.warn('%s master_down', self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s master_down',
|
||||
self.__class__.__name__)
|
||||
|
||||
def adver(self, ev):
|
||||
self.vrrp_router.logger.warn('%s adver', self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s adver', self.__class__.__name__)
|
||||
|
||||
def preempt_delay(self, ev):
|
||||
self.vrrp_router.logger.warn('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
|
||||
def vrrp_received(self, ev):
|
||||
self.vrrp_router.logger.warn('%s vrrp_received',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s vrrp_received',
|
||||
self.__class__.__name__)
|
||||
|
||||
def vrrp_shutdown_request(self, ev):
|
||||
self.vrrp_router.logger.warn('%s vrrp_shutdown_request',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s vrrp_shutdown_request',
|
||||
self.__class__.__name__)
|
||||
|
||||
def vrrp_config_change_request(self, ev):
|
||||
self.vrrp_router.logger.warn('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
|
||||
|
||||
class VRRPV2StateMaster(VRRPState):
|
||||
@ -325,8 +326,8 @@ class VRRPV2StateMaster(VRRPState):
|
||||
self._adver()
|
||||
|
||||
def preempt_delay(self, ev):
|
||||
self.vrrp_router.logger.warn('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
|
||||
def vrrp_received(self, ev):
|
||||
vrrp_router = self.vrrp_router
|
||||
@ -360,8 +361,8 @@ class VRRPV2StateMaster(VRRPState):
|
||||
|
||||
def vrrp_config_change_request(self, ev):
|
||||
vrrp_router = self.vrrp_router
|
||||
vrrp_router.logger.warn('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
vrrp_router.logger.warning('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
if ev.priority is not None or ev.advertisement_interval is not None:
|
||||
vrrp_router.adver_timer.cancel()
|
||||
self._adver()
|
||||
@ -404,8 +405,8 @@ class VRRPV2StateBackup(VRRPState):
|
||||
ev.__class__.__name__, vrrp_router.state)
|
||||
|
||||
def preempt_delay(self, ev):
|
||||
self.vrrp_router.logger.warn('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
self._master_down()
|
||||
|
||||
def vrrp_received(self, ev):
|
||||
@ -440,8 +441,8 @@ class VRRPV2StateBackup(VRRPState):
|
||||
|
||||
def vrrp_config_change_request(self, ev):
|
||||
vrrp_router = self.vrrp_router
|
||||
vrrp_router.logger.warn('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
vrrp_router.logger.warning('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
if ev.priority is not None and vrrp_router.config.address_owner:
|
||||
vrrp_router.master_down_timer.cancel()
|
||||
self._master_down()
|
||||
@ -494,8 +495,8 @@ class VRRPV3StateInitialize(VRRPState):
|
||||
self.vrrp_router.logger.debug('%s adver', self.__class__.__name__)
|
||||
|
||||
def preempt_delay(self, ev):
|
||||
self.vrrp_router.logger.warn('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
|
||||
def vrrp_received(self, ev):
|
||||
self.vrrp_router.logger.debug('%s vrrp_received',
|
||||
@ -506,8 +507,8 @@ class VRRPV3StateInitialize(VRRPState):
|
||||
self.__class__.__name__)
|
||||
|
||||
def vrrp_config_change_request(self, ev):
|
||||
self.vrrp_router.logger.warn('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
|
||||
|
||||
class VRRPV3StateMaster(VRRPState):
|
||||
@ -530,8 +531,8 @@ class VRRPV3StateMaster(VRRPState):
|
||||
self._adver()
|
||||
|
||||
def preempt_delay(self, ev):
|
||||
self.vrrp_router.logger.warn('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
|
||||
def vrrp_received(self, ev):
|
||||
vrrp_router = self.vrrp_router
|
||||
@ -566,8 +567,8 @@ class VRRPV3StateMaster(VRRPState):
|
||||
|
||||
def vrrp_config_change_request(self, ev):
|
||||
vrrp_router = self.vrrp_router
|
||||
vrrp_router.logger.warn('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
vrrp_router.logger.warning('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
if ev.priority is not None or ev.advertisement_interval is not None:
|
||||
vrrp_router.adver_timer.cancel()
|
||||
self._adver()
|
||||
@ -621,8 +622,8 @@ class VRRPV3StateBackup(VRRPState):
|
||||
ev.__class__.__name__, vrrp_router.state)
|
||||
|
||||
def preempt_delay(self, ev):
|
||||
self.vrrp_router.logger.warn('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
self.vrrp_router.logger.warning('%s preempt_delay',
|
||||
self.__class__.__name__)
|
||||
self._master_down()
|
||||
|
||||
def vrrp_received(self, ev):
|
||||
@ -657,8 +658,8 @@ class VRRPV3StateBackup(VRRPState):
|
||||
|
||||
def vrrp_config_change_request(self, ev):
|
||||
vrrp_router = self.vrrp_router
|
||||
vrrp_router.logger.warn('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
vrrp_router.logger.warning('%s vrrp_config_change_request',
|
||||
self.__class__.__name__)
|
||||
if ev.priority is not None and vrrp_router.config.address_owner:
|
||||
vrrp_router.master_down_timer.cancel()
|
||||
self._master_down()
|
||||
|
Loading…
Reference in New Issue
Block a user