Skip to content

Commit

Permalink
Fix getting leader status
Browse files Browse the repository at this point in the history
  • Loading branch information
AMEST authored Jan 11, 2022
1 parent 04d1779 commit 4ffd14c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/docker_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def isLeader(self):
return False
nodeList = self.dockerClient.nodes.list(filters={'role': 'manager'})
nodeAddr = self.nodeInfo['Swarm']['NodeAddr']
managerLeader = list(x for x in nodeList if x.attrs['ManagerStatus']['Leader'])[0]
managerLeader = list(x for x in nodeList if x.attrs['ManagerStatus'].get('Leader'))[0]
return managerLeader.attrs['ManagerStatus']['Addr'].startswith(nodeAddr)

def getAutoscaleServices(self):
Expand Down

0 comments on commit 4ffd14c

Please sign in to comment.