From 48a9fe01a4b4b96c111945c60296a2484d1c438b Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Mon, 11 Jan 2016 14:08:47 +0000 Subject: [PATCH] Added orchestrastatus management command --- TODO.md | 2 +- orchestra/management/commands/orchestrastatus.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 6973ecf6..9f8921d7 100644 --- a/TODO.md +++ b/TODO.md @@ -454,4 +454,4 @@ mkhomedir_helper or create ssh homes with bash.rc and such # Reverse lOgHistory order by date (lastest first) -* orchestrastatus command, showing if it is runningg, in what URL and stuff +* setuppostgres use porject_name for db name and user instead of orchestra diff --git a/orchestra/management/commands/orchestrastatus.py b/orchestra/management/commands/orchestrastatus.py index e0db4ec5..103c501f 100644 --- a/orchestra/management/commands/orchestrastatus.py +++ b/orchestra/management/commands/orchestrastatus.py @@ -41,7 +41,7 @@ class Command(BaseCommand): self.stdout.write(" %(service)s offline" % context) if service == 'nginx': try: - config_path = '/etc/nginx/conf.d/%(project_name)s.conf' % context + config_path = '/etc/nginx/sites-enabled/%(project_name)s.conf' % context with open(config_path, 'r') as handler: config = handler.read().replace('\n', ' ') except FileNotFoundError: @@ -65,6 +65,12 @@ class Command(BaseCommand): self.stdout.write(" * DB connection failed") else: self.stdout.write(" * DB connection succeeded") + elif service == 'uwsgi': + uwsgi_config = '/etc/uwsgi/apps-enabled/%(project_name)s.ini' % context + if os.path.isfile(uwsgi_config): + self.stdout.write(" * %s exists" % uwsgi_config) + else: + self.stdout.write(" * %s does not exist" % uwsgi_config) cronbeat = 'crontab -l | grep "^.*/orchestra-beat %(site_dir)s/manage.py"' % context if run(cronbeat, valid_codes=(0, 1)).exit_code == 0: self.stdout.write(" cronbeat installed")