From 3475b97a917f22c549aa8f2abfcf86f78642636f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 9 Apr 2019 15:36:58 -0400 Subject: [PATCH] Workaround 'dead' IPv4 addresses Some redfish implementations leave a dead DHCP definition when configured static. Filter out such an address when encountered. Change-Id: I25ff6b07ff75b67f7661157a8a0f1dc230f9010c --- pyghmi/redfish/command.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index bc1fb4e2..8eeb7c1d 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -474,6 +474,9 @@ class Command(object): if not ipv4: raise exc.PyghmiException('Unable to locate network information') retval = {} + if len(netcfg['IPv4Addresses']) != 1: + netcfg['IPv4Addresses'] = [x for x in + netcfg['IPv4Addresses'] if x['Address'] != '0.0.0.0'] if len(netcfg['IPv4Addresses']) != 1: raise exc.PyghmiException('Multiple IP addresses not supported') currip = netcfg['IPv4Addresses'][0]