From a36bbe96e4001f85c8e8ee24583ac7fded162c2c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 9 Nov 2021 12:12:49 -0500 Subject: [PATCH] Fix redfish operation over ipv6 link local Change-Id: I50149cc0eeea2affe727ddd6888cd656c52f6c1f --- pyghmi/redfish/command.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 5ec29368..40f570dc 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -258,7 +258,9 @@ class Command(object): if addrinf[0] == socket.AF_INET: self._bmcv4ip = socket.inet_pton(addrinf[0], addrinf[-1][0]) elif addrinf[0] == socket.AF_INET6: - self._bmcv6ip = socket.inet_pton(addrinf[0], addrinf[-1][0]) + theip = addrinf[-1][0] + theip = theip.split('%')[0] + self._bmcv6ip = socket.inet_pton(addrinf[0], theip) self.wc.set_header('Accept', 'application/json') self.wc.set_header('User-Agent', 'pyghmi') self.wc.set_header('Accept-Encoding', 'gzip')