fix: make python commands modular and reusable

This commit is contained in:
Revant Nandgaonkar
2020-03-20 20:56:23 +05:30
parent 8ce9d4214d
commit 7c356ccb27
8 changed files with 112 additions and 95 deletions

View File

@@ -108,6 +108,13 @@ def check_redis_socketio(retry=10, delay=3, print_attempt=True):
print("Connection to redis socketio timed out")
exit(1)
# Get site_config.json
def get_site_config(site_name):
site_config = None
with open('{site_name}/site_config.json'.format(site_name=site_name)) as site_config_file:
site_config = json.load(site_config_file)
return site_config
def main():
check_mariadb()
check_redis_queue()
@@ -116,4 +123,4 @@ def main():
print('Connections OK')
if __name__ == "__main__":
main()
main()