blob: 2e916deb5f9c3cac30e227ff7753af3cb8daf57a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/usr/bin/env python3
import logging.config
import os
import sys
import time
import schedule
import yaml
from app_config import pnfconfig
from pnf import PNF
log_file_path = os.path.join(os.path.dirname(__file__), 'app_config/logger_config.yaml')
with open(log_file_path, 'r') as f:
log_cfg = yaml.safe_load(f.read())
logging.config.dictConfig(log_cfg)
logger = logging.getLogger('dev')
if __name__ == "__main__":
try:
schedule.every(pnfconfig.ROP).seconds.do(PNF.pm_job)
logger.info('Starting PM scheduling job')
while True:
schedule.run_pending()
time.sleep(1)
except Exception as error:
logger.debug(error)
sys.exit(1)
|