diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-03-17 21:05:57 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-03-17 21:05:57 +0000 |
commit | 23a158721e547c29e682be15b197a089c9af0e1a (patch) | |
tree | 5c96cfd06e9a9011c579a0bb5a15c192027ed8ce /src/lib/Server | |
parent | fe68e3337aea74836bc5d9fbdd5dd673d900e76f (diff) | |
download | bcfg2-23a158721e547c29e682be15b197a089c9af0e1a.tar.gz bcfg2-23a158721e547c29e682be15b197a089c9af0e1a.tar.bz2 bcfg2-23a158721e547c29e682be15b197a089c9af0e1a.zip |
fix tiebreaks
(Logical change 1.212)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@900 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Generators/Cfg.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/Server/Generators/Cfg.py b/src/lib/Server/Generators/Cfg.py index 174879a34..7d3eba57a 100644 --- a/src/lib/Server/Generators/Cfg.py +++ b/src/lib/Server/Generators/Cfg.py @@ -32,7 +32,15 @@ class FileEntry(FileBacked): most2 = [index for index in range(len(fields)) if getattr(other, fields[index])][0] except IndexError: most2 = 0 - return most1 - most2 + if most1 == most2: + if self.name.split('.')[1][0] not in ['C', 'B']: + return 0 + # need to tiebreak with numeric prio + prio1 = int(self.name.split('.')[1][1:2]) + prio2 = int(other.name.split('.')[1][1:2]) + return prio1 - prio2 + else: + return most1 - most2 class ConfigFileEntry(object): '''ConfigFileEntry is a repository entry for a single file, containing |