From 9f5f6640804e255b05adfa34de9dd4d900fcdcbf Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Fri, 16 Dec 2016 12:59:55 +0000 Subject: Advertise the correct address when using IPv6 Parse the output of "ip route get $IP" taking IPv6 into consideration. Also wrap the IP address in square brackets if it is IPv6. Change-Id: Ifc44e5aa3c5b814b6ceba04461bb68fe1d75c22b Closes-Bug: #1650533 --- ironic_python_agent/agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ironic_python_agent/agent.py') diff --git a/ironic_python_agent/agent.py b/ironic_python_agent/agent.py index 6ac11c97..281c4803 100644 --- a/ironic_python_agent/agent.py +++ b/ironic_python_agent/agent.py @@ -210,7 +210,7 @@ class IronicPythonAgent(base.ExecuteCommandMixin): return try: - return out.strip().split('\n')[0].split('src')[1].strip() + return out.strip().split('\n')[0].split('src')[1].split()[0] except IndexError: LOG.warning('No route to host %(dest)s, route record: %(rec)s', {'dest': dest, 'rec': out}) -- cgit v1.2.1