diff options
-rw-r--r-- | sdnvpn/lib/logutil.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sdnvpn/lib/logutil.py b/sdnvpn/lib/logutil.py index 78f6e96..3765734 100644 --- a/sdnvpn/lib/logutil.py +++ b/sdnvpn/lib/logutil.py @@ -8,6 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # import logging +import os.path from xtesting.core import feature @@ -15,6 +16,7 @@ from xtesting.core import feature def getLogger(module_name): logger = logging.getLogger(module_name) log_file = "{}/{}.log".format("/var/lib/xtesting/results", "bgpvpn") - open(log_file, 'w+') + if not os.path.exists(log_file): + open(log_file, 'w+') feature.Feature.configure_logger(logger, log_file) return logger |