]> git.ipfire.org Git - ipfire.org.git/commitdiff
fireinfo: Fix profile validation when importing profiles
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 1 Mar 2015 22:10:47 +0000 (23:10 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 1 Mar 2015 22:10:47 +0000 (23:10 +0100)
webapp/backend/fireinfo.py

index 09396dea2c67565279b2741633137f769c33e72d..68da9a43da011aaeb74c8ebf3078f2328080e29d 100644 (file)
@@ -72,6 +72,9 @@ class ProfileDict(object):
 
 class ProfileNetwork(ProfileDict):
        def __eq__(self, other):
+               if other is None:
+                       return False
+
                if not self.has_red == other.has_red:
                        return False
 
@@ -1235,6 +1238,10 @@ class ProfileParser(Object):
                        for arg in self.__device_args:
                                args[arg] = _device.get(arg, None)
 
+                       # Skip if the subsystem is not set
+                       if not args.get("subsystem", None):
+                               continue
+
                        # Find the device or create a new one.
                        device = self.fireinfo.get_device(**args)
                        if not device: