updated logging usage, to use the library directly and avoid imposing a core config by default, allowing users of the core library to configure logging as desired

This commit is contained in:
bharnden 2019-02-16 09:50:19 -08:00
parent 37f747c212
commit 7aee2b2ba7
44 changed files with 552 additions and 527 deletions

View file

@ -3,8 +3,9 @@ security.py: defines security services (vpnclient, vpnserver, ipsec and
firewall)
"""
import logging
from core import constants
from core import logger
from core.service import CoreService
@ -29,7 +30,7 @@ class VPNClient(CoreService):
try:
cfg += open(fname, "rb").read()
except IOError:
logger.exception("Error opening VPN client configuration template (%s)", fname)
logging.exception("Error opening VPN client configuration template (%s)", fname)
return cfg
@ -56,7 +57,7 @@ class VPNServer(CoreService):
try:
cfg += open(fname, "rb").read()
except IOError:
logger.exception("Error opening VPN server configuration template (%s)", fname)
logging.exception("Error opening VPN server configuration template (%s)", fname)
return cfg
@ -83,7 +84,7 @@ class IPsec(CoreService):
try:
cfg += open(fname, "rb").read()
except IOError:
logger.exception("Error opening IPsec configuration template (%s)", fname)
logging.exception("Error opening IPsec configuration template (%s)", fname)
return cfg
@ -107,7 +108,7 @@ class Firewall(CoreService):
try:
cfg += open(fname, "rb").read()
except IOError:
logger.exception("Error opening Firewall configuration template (%s)", fname)
logging.exception("Error opening Firewall configuration template (%s)", fname)
return cfg