summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2004-10-27 19:41:18 +0000
committerNarayan Desai <desai@mcs.anl.gov>2004-10-27 19:41:18 +0000
commit694e8b7c746d4b334ea7f203d044e37d0fab7ae9 (patch)
tree39c2f47741eec250df71d6cf3c509143b30fb0d2 /src/lib
parent9dac23d7adabb777e1cebaf61942a48e052442a9 (diff)
downloadbcfg2-694e8b7c746d4b334ea7f203d044e37d0fab7ae9.tar.gz
bcfg2-694e8b7c746d4b334ea7f203d044e37d0fab7ae9.tar.bz2
bcfg2-694e8b7c746d4b334ea7f203d044e37d0fab7ae9.zip
fix interation over non-sequence
(Logical change 1.120) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@530 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Metadata.py6
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):