Blame view

src/majordome/start_agent_majordome.py 703 Bytes
03814884   Etienne Pallier   launch majordome ...
1
#!/usr/bin/env python
b4e8963c   Etienne Pallier   Each agent (envmo...
2
3
4

import os
import sys
d51386bf   Etienne Pallier   new file majordom...
5
6
from django.conf import settings as djangosettings

b4e8963c   Etienne Pallier   Each agent (envmo...
7
8
9
10

# DJANGO setup
#sys.path.append('/PROJECTS/GFT/SOFT/PYROS_SOFT/PYROS201802')
sys.path.append('..')
03814884   Etienne Pallier   launch majordome ...
11
#print("file is", __file__)
d51386bf   Etienne Pallier   new file majordom...
12
#mypath = os.getcwd()
03814884   Etienne Pallier   launch majordome ...
13

b4e8963c   Etienne Pallier   Each agent (envmo...
14
15
16
17
18
19
20
21
22
# 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()

d51386bf   Etienne Pallier   new file majordom...
23
24
25
print("DB2 used is:", djangosettings.DATABASES['default']['NAME'])


b4e8963c   Etienne Pallier   Each agent (envmo...
26
27
28
29
30
31
# MONITORING AGENT setup
agent="majordome"

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