diff options
| author | Derek Higgins <derekh@redhat.com> | 2016-12-16 12:59:55 +0000 |
|---|---|---|
| committer | Derek Higgins <derekh@redhat.com> | 2017-01-11 11:00:56 +0000 |
| commit | 9f5f6640804e255b05adfa34de9dd4d900fcdcbf (patch) | |
| tree | 5cb14d0265a214f352893fa669f50051d4b3970d /ironic_python_agent/agent.py | |
| parent | a6b09f2fa85f397cfda6a43ce19c995c8a3be76d (diff) | |
| download | ironic-python-agent-9f5f6640804e255b05adfa34de9dd4d900fcdcbf.tar.gz | |
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
Diffstat (limited to 'ironic_python_agent/agent.py')
| -rw-r--r-- | ironic_python_agent/agent.py | 2 |
1 files changed, 1 insertions, 1 deletions
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}) |
