Fix deprecation warnings in pkg_resources

Fix the following deprecation warnings.

  PkgResourcesDeprecationWarning:
  <MagicMock name='execute().split().__getitem__().__getitem__()'
  id='140417024565696'> is an invalid version and will not be
  supported in a future release

  DeprecationWarning: Creating a LegacyVersion has been
  deprecated and will be removed in the next major release

Change-Id: I23540114120f6ea52754116cfaaeac35e09543b4
Closes-Bug: 1986428
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
(cherry picked from commit 76cf6b4a9e)
This commit is contained in:
Takashi Natsume 2022-08-13 22:30:51 +09:00 committed by Brian Haley
parent b35f24b91e
commit a26f04d711
1 changed files with 1 additions and 0 deletions

View File

@ -303,6 +303,7 @@ class TestDvrRouterOperations(base.BaseTestCase):
self.assertFalse(ri.floating_forward_rules(fip))
def test_floating_forward_rules(self):
self.utils_exec.return_value = "iptables v1.6.2 (legacy)"
router = mock.MagicMock()
router.get.return_value = [{'host': HOSTNAME},
{'host': mock.sentinel.otherhost}]