From e2b245e4ab27492990baf4743bae4b8fca0c7a71 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Wed, 8 Dec 2010 10:38:23 -0500 Subject: [PATCH] Fix gateway logic for secondary interfaces. --- PLC/Interfaces.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PLC/Interfaces.py b/PLC/Interfaces.py index c8ccd2ec..8e5d4b68 100644 --- a/PLC/Interfaces.py +++ b/PLC/Interfaces.py @@ -184,10 +184,11 @@ class Interface(Row): # DHCP! elif method == "static": - if 'is_primary' in self and self['is_primary'] is True: - for key in ['gateway', 'dns1']: - if key not in self or not self[key]: + for key in ['gateway', 'dns1']: + if key not in self or not self[key]: + if 'is_primary' in self and self['is_primary'] is True: raise PLCInvalidArgument, "For static method primary network, %s is required" % key + else: globals()[key] = self[key] for key in ['ip', 'network', 'broadcast', 'netmask']: if key not in self or not self[key]: -- 2.47.0