Skip to content

Commit

Permalink
Sort nodes in devops.models.environment.Node()
Browse files Browse the repository at this point in the history
Nodes should be sortered by name to avoid inconsistency between
devops and system tests

Change-Id: I155d6669795f6cad12397abc7f1374391faf53ce
Closes-Bug:#1477169
  • Loading branch information
dis-xcom committed Jul 22, 2015
1 parent 8d528b0 commit b7696dc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions devops/models/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,13 @@ def __init__(self,

class Nodes(object):
def __init__(self, environment, node_roles):
self.admins = list(
environment.get_nodes(name__in=node_roles.admin_names)
self.admins = sorted(
list(environment.get_nodes(name__in=node_roles.admin_names)),
key=lambda node: node.name
)
self.others = list(
environment.get_nodes(name__in=node_roles.other_names)
self.others = sorted(
list(environment.get_nodes(name__in=node_roles.other_names)),
key=lambda node: node.name
)
self.slaves = self.others
self.all = self.slaves + self.admins
Expand Down

0 comments on commit b7696dc

Please sign in to comment.