From 4c185438e6b07b647457068de45a73a42352f886 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Mon, 8 Jun 2020 10:25:29 +0200 Subject: [PATCH] Fix for latest zeroconf version The zeroconf library removed address in version 0.27.0 [1] This patch should fix potential issues with that change. [1] https://github.com/jstasiak/python-zeroconf/#changelog Change-Id: I694ae5587ac8c3aae43d98902f56738773d31284 --- ironic_lib/tests/test_mdns.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ironic_lib/tests/test_mdns.py b/ironic_lib/tests/test_mdns.py index 0195d5ca..3e212198 100644 --- a/ironic_lib/tests/test_mdns.py +++ b/ironic_lib/tests/test_mdns.py @@ -36,7 +36,7 @@ class RegisterServiceTestCase(base.IronicLibTestCase): info = mock_zc.return_value.register_service.call_args[0][0] self.assertEqual('_openstack._tcp.local.', info.type) self.assertEqual('baremetal._openstack._tcp.local.', info.name) - self.assertEqual('127.0.0.1', socket.inet_ntoa(info.address)) + self.assertEqual('127.0.0.1', socket.inet_ntoa(info.addresses[0])) self.assertEqual({'path': '/baremetal'}, info.properties) def test_with_params(self, mock_zc): @@ -49,7 +49,7 @@ class RegisterServiceTestCase(base.IronicLibTestCase): info = mock_zc.return_value.register_service.call_args[0][0] self.assertEqual('_openstack._tcp.local.', info.type) self.assertEqual('baremetal._openstack._tcp.local.', info.name) - self.assertEqual('127.0.0.1', socket.inet_ntoa(info.address)) + self.assertEqual('127.0.0.1', socket.inet_ntoa(info.addresses[0])) self.assertEqual({'path': '/baremetal', 'answer': 42, 'foo': 'bar'}, @@ -80,7 +80,7 @@ class RegisterServiceTestCase(base.IronicLibTestCase): info = mock_zc.return_value.register_service.call_args[0][0] self.assertEqual('_openstack._tcp.local.', info.type) self.assertEqual('baremetal._openstack._tcp.local.', info.name) - self.assertEqual('127.0.0.1', socket.inet_ntoa(info.address)) + self.assertEqual('127.0.0.1', socket.inet_ntoa(info.addresses[0])) self.assertEqual({'path': '/baremetal'}, info.properties) @mock.patch.object(mdns.time, 'sleep', autospec=True)