aboutsummaryrefslogtreecommitdiffstats
path: root/policyhandler/onap
diff options
context:
space:
mode:
Diffstat (limited to 'policyhandler/onap')
-rw-r--r--policyhandler/onap/CommonLogger.py27
-rw-r--r--policyhandler/onap/audit.py18
-rw-r--r--policyhandler/onap/health.py4
3 files changed, 25 insertions, 24 deletions
diff --git a/policyhandler/onap/CommonLogger.py b/policyhandler/onap/CommonLogger.py
index a70ca28..0ab64e4 100644
--- a/policyhandler/onap/CommonLogger.py
+++ b/policyhandler/onap/CommonLogger.py
@@ -1,15 +1,5 @@
#!/usr/bin/python
# -*- indent-tabs-mode: nil -*- vi: set expandtab:
-"""ECOMP Common Logging library in Python.
-
-CommonLogger.py
-
-Original Written by: Terry Schmalzried
-Date written: October 1, 2015
-Last updated: December 1, 2016
-
-version 0.8
-"""
# org.onap.dcae
# ================================================================================
@@ -30,6 +20,17 @@ version 0.8
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+"""ECOMP Common Logging library in Python.
+
+CommonLogger.py
+
+Original Written by: Terry Schmalzried
+Date written: October 1, 2015
+Last updated: December 1, 2016
+
+version 0.8
+"""
+
from __future__ import print_function
import os, sys, getopt, logging, logging.handlers, time, re, uuid, socket, threading, collections
@@ -203,7 +204,7 @@ class CommonLogger:
self._logHandler = logging.handlers.RotatingFileHandler(self._logFile, \
mode=self._sizeRotateMode, maxBytes=self._sizeMaxBytes, \
backupCount=self._backupCount, encoding=None, delay=False)
-
+
else:
self._logHandler = logging.handlers.WatchedFileHandler(self._logFile, \
mode=self._sizeRotateMode, \
@@ -860,7 +861,7 @@ if __name__ == "__main__":
parser.add_argument("-k", "--keeplogs", help="Keep the log files after finishing the tests", action="store_true")
parser.add_argument("-v", "--verbose", help="Print debugging messages", action="store_true")
args = parser.parse_args()
-
+
spid = str(os.getpid())
if args.keeplogs:
spid = ""
@@ -878,7 +879,7 @@ if __name__ == "__main__":
os.remove(f)
except:
pass
- if not args.keeplogs:
+ if not args.keeplogs:
atexit.register(cleanupTmps)
with open(logcfg, "w") as o:
diff --git a/policyhandler/onap/audit.py b/policyhandler/onap/audit.py
index c338b76..8fd5ed3 100644
--- a/policyhandler/onap/audit.py
+++ b/policyhandler/onap/audit.py
@@ -1,12 +1,3 @@
-"""generic class to keep track of request handling
- from receiving it through reponse and log all the activities
-
- call Audit.init("component-name", "path/to/config_file") to init the loggers before any requests
-
- start each outside request with creation of the Audit object
- audit = Audit(request_id=None, headers=None, msg=None)
-"""
-
# org.onap.dcae
# ================================================================================
# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
@@ -26,6 +17,15 @@
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+"""generic class to keep track of request handling
+ from receiving it through reponse and log all the activities
+
+ call Audit.init("component-name", "path/to/config_file") to init the loggers before any requests
+
+ start each outside request with creation of the Audit object
+ audit = Audit(request_id=None, headers=None, msg=None)
+"""
+
import os
import sys
import json
diff --git a/policyhandler/onap/health.py b/policyhandler/onap/health.py
index eefa7d2..4475575 100644
--- a/policyhandler/onap/health.py
+++ b/policyhandler/onap/health.py
@@ -1,5 +1,3 @@
-"""generic class to keep track of app health"""
-
# org.onap.dcae
# ================================================================================
# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
@@ -19,6 +17,8 @@
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+"""generic class to keep track of app health"""
+
import uuid
from threading import Lock
from datetime import datetime