X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fserver%2Finterface.py;fp=sfa%2Fserver%2Finterface.py;h=4ae8e9fc5c6db68a43ab20d2404b08073d8ef71d;hb=388315b1b7e94e09a1b717d38693a03be5e23058;hp=05034795e8bb65cebcfb1b549edf97a3e541aa57;hpb=f3d825457ff4881b8c9658967f8ed159a01dfcaa;p=sfa.git diff --git a/sfa/server/interface.py b/sfa/server/interface.py index 05034795..4ae8e9fc 100644 --- a/sfa/server/interface.py +++ b/sfa/server/interface.py @@ -61,8 +61,17 @@ class Interfaces(dict): if not isinstance(interfaces, list): interfaces = [self.interfaces] self.interfaces = {} + required_fields = self.default_fields.keys() for interface in interfaces: - self.interfaces[interface['hrn']] = interface + valid = True + # skp any interface definition that has a null hrn, + # address or port + for field in required_fields: + if field not in interface or not interface[field]: + valid = False + break + if valid: + self.interfaces[interface['hrn']] = interface def sync_interfaces(self):