From ce333b3bfc069c806300eafa2e0bf1ade034a163 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 23 Mar 2021 07:57:23 -0400 Subject: [PATCH] Fix DHCP config logic on static input Have static address and gateway both clarify so that the DHCP logic does not get confused. Change-Id: If1fa41e27c34694fc47d6a805c72ef6922ab38f4 --- pyghmi/redfish/command.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 36489ec7..4ad54aa7 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -1168,11 +1168,13 @@ class Command(object): netmask = _cidr_to_mask(int(cidr)) patch['IPv4StaticAddresses'] = [ipinfo] ipinfo['Address'] = ipv4_address + ipv4_configuration = 'static' if netmask: ipinfo['SubnetMask'] = netmask if ipv4_gateway: patch['IPv4StaticAddresses'] = [ipinfo] ipinfo['Gateway'] = ipv4_gateway + ipv4_configuration = 'static' if ipv4_configuration.lower() == 'dhcp': dodhcp = True patch['DHCPv4'] = {'DHCPEnabled': True}