Merge pull request #3526 from minrk/clusterlist

ensure 'default' is first in cluster profile list

when sorting, 'default' is transformed to ''.
This commit is contained in:
Matthias Bussonnier 2013-07-05 07:35:59 -07:00
commit cefbcbead1

View File

@ -87,7 +87,9 @@ class ClusterManager(LoggingConfigurable):
def list_profiles(self):
self.update_profiles()
result = [self.profile_info(p) for p in sorted(self.profiles.keys())]
# sorted list, but ensure that 'default' always comes first
default_first = lambda name: name if name != 'default' else ''
result = [self.profile_info(p) for p in sorted(self.profiles, key=default_first)]
return result
def check_profile(self, profile):