diff options
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Metadata.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/Server/Metadata.py b/src/lib/Server/Metadata.py index feb5bbd14..d4f25708e 100644 --- a/src/lib/Server/Metadata.py +++ b/src/lib/Server/Metadata.py @@ -38,8 +38,10 @@ class Metadata(object): def __cmp__(self, other): fields = ['image', 'classes', 'bundles', 'attributes', 'hostname'] - sum1 = [x for x in len(fields) if getattr(self, fields[x])][0] - sum2 = [x for x in len(fields) if getattr(other, fields[x])][0] + sum1 = [len(field) for field in fields if getattr(self,field)][0] + + sum1 = [x for x in range(len(fields)) if getattr(self, fields[x])][0] + sum2 = [x for x in range(len(fields)) if getattr(other, fields[x])][0] return sum1 < sum2 class Profile(object): |