start_agent_majordome.py 703 Bytes
#!/usr/bin/env python

import os
import sys
from django.conf import settings as djangosettings


# DJANGO setup
#sys.path.append('/PROJECTS/GFT/SOFT/PYROS_SOFT/PYROS201802')
sys.path.append('..')
#print("file is", __file__)
#mypath = os.getcwd()

# Go into src/
os.chdir('..')
#print("Current directory : " + str(os.getcwd()))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.pyros.settings")
#os.environ['SECRET_KEY'] = 'abc'
#os.environ['ENVIRONMENT'] = 'production'
import django
django.setup()

print("DB2 used is:", djangosettings.DATABASES['default']['NAME'])


# MONITORING AGENT setup
agent="majordome"

if agent=="majordome":
    from majordome.tasks import Majordome
    Majordome().run()