Last active
August 29, 2015 13:57
-
-
Save Apsu/9371605 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_master(self): | |
"""Return true if there's only one master and we're it""" | |
masters = [ | |
key | |
for key in self.store.keys() | |
if self.store[key]["master"] | |
] | |
if len(masters) == 1 and masters[0] == self.hostname: | |
return True | |
else: | |
return False |
cloudnull
commented
Mar 5, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment