Created
September 12, 2012 18:35
-
-
Save sargun/3708925 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
#!/usr/bin/python | |
import yaml, os | |
dropwizard_services = ['streamie', 'mugshot'] | |
class dropwizard_healthcheck(object): | |
def __init__(self, servicename): | |
def main(): | |
has_services = [] | |
healthchecks = [] | |
config_file = '/etc/%s.yml' | |
for service_name in dropwizard_services: | |
if os.access(config_file % service_name, os.R_OK): | |
has_services.append(service_name) | |
for service_name in has_services: | |
healthchecks.append(dropwizard_healthcheck(service_name)) | |
for healthcheck in healthchecks: | |
healthcheck.healthcheck() | |
#Render / print | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment