Created
August 19, 2015 22:29
-
-
Save adamv/b97aa9363a90378394b9 to your computer and use it in GitHub Desktop.
When the run-if boostrap action doesn't work...
This file contains hidden or 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
| check_if_master() { | |
| python - <<'__SCRIPT__' | |
| import sys | |
| import json | |
| instance_file = "/mnt/var/lib/info/instance.json" | |
| with open(instance_file) as f: | |
| props = json.load(f) | |
| is_master = props.get('isMaster', False) | |
| if is_master: | |
| sys.exit(0) | |
| else: | |
| sys.exit(1) | |
| __SCRIPT__ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment