diff --git a/oslo_utils/netutils.py b/oslo_utils/netutils.py index 3d8a2a2c..19f54e73 100644 --- a/oslo_utils/netutils.py +++ b/oslo_utils/netutils.py @@ -112,7 +112,7 @@ def is_valid_ipv4(address, strict=None): return True else: if netaddr.valid_ipv4(address): - LOG.warn( + LOG.warning( 'Converting in non strict mode is deprecated. ' 'You should pass strict=False if you want to ' 'preserve legacy behavior') diff --git a/oslo_utils/tests/test_netutils.py b/oslo_utils/tests/test_netutils.py index 93fedf39..087522cb 100644 --- a/oslo_utils/tests/test_netutils.py +++ b/oslo_utils/tests/test_netutils.py @@ -166,16 +166,16 @@ class NetworkUtilsTest(test_base.BaseTestCase): self.assertFalse(netutils.is_valid_ipv4('')) self.assertTrue(netutils.is_valid_ipv4('10')) - mock_log.warn.assert_called_with(expected_log) + mock_log.warning.assert_called_with(expected_log) mock_log.reset_mock() self.assertTrue(netutils.is_valid_ipv4('10.10')) - mock_log.warn.assert_called_with(expected_log) + mock_log.warning.assert_called_with(expected_log) mock_log.reset_mock() self.assertTrue(netutils.is_valid_ipv4('10.10.10')) - mock_log.warn.assert_called_with(expected_log) + mock_log.warning.assert_called_with(expected_log) mock_log.reset_mock() self.assertTrue(netutils.is_valid_ipv4('10.10.10.10')) - mock_log.warn.assert_not_called() + mock_log.warning.assert_not_called() mock_log.reset_mock() self.assertFalse( netutils.is_valid_ipv4('10', strict=True) @@ -186,7 +186,7 @@ class NetworkUtilsTest(test_base.BaseTestCase): self.assertFalse( netutils.is_valid_ipv4('10.10.10', strict=True) ) - mock_log.warn.assert_not_called() + mock_log.warning.assert_not_called() mock_log.reset_mock() self.assertTrue( netutils.is_valid_ipv4('10', strict=False) @@ -197,7 +197,7 @@ class NetworkUtilsTest(test_base.BaseTestCase): self.assertTrue( netutils.is_valid_ipv4('10.10.10', strict=False) ) - mock_log.warn.assert_not_called() + mock_log.warning.assert_not_called() mock_log.reset_mock() def test_is_valid_ipv6(self):