X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FInterfaces.py;fp=PLC%2FInterfaces.py;h=7e72f74e803d23f21fbee1648ac71a5ec75bcc81;hb=7ce6dcefaa4545dcf468ab3178a9a66ab839e733;hp=bd933cd4b44e09bc8311672c7104160ac04ba012;hpb=a2b3ff76d6d55a6085d44a90bc25858c261b9b43;p=plcapi.git diff --git a/PLC/Interfaces.py b/PLC/Interfaces.py index bd933cd..7e72f74 100644 --- a/PLC/Interfaces.py +++ b/PLC/Interfaces.py @@ -186,10 +186,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]: