Commit 99d398dd authored by Rob Carleski's avatar Rob Carleski 🇮🇸
Browse files

Small tweaks and formatting changes.

* also fix pep8 issue in associated test
parent 9813dd34
......@@ -276,14 +276,14 @@ class Archiver():
if line['actor.email']:
body = ('type=login,'
'type={},'
'datetime={},'
'event_time={},'
'ip_address={}'.format(
line['name'],
line['id.time'],
line['ipAddress']
))
if line['parameters.2.boolValue']:
body += 'suspicious={}'.format(
body += ',suspicious={}'.format(
line['parameters.2.boolValue']
)
self.logger.info(
......@@ -463,8 +463,7 @@ Used with login reporting to account for inherant delay.''',
config = yaml.load(stream, Loader=yaml.BaseLoader)
# Oerride the default syslog format for this one.
config['general']['log_format'] = ("level=%(levelname)s"
",%(message)s,"
config['general']['log_format'] = ("%(message)s,"
"entity=%(entity)s"
)
......@@ -479,20 +478,10 @@ Used with login reporting to account for inherant delay.''',
)
formatter = logging.Formatter(
config['general']['log_format'],
config['general']['log_date_format']
)
sh.setFormatter(formatter)
logger.addHandler(sh)
# Create a console handler, set format, and associate.
ch = logging.StreamHandler()
formatter = logging.Formatter(
config['general']['console_format'],
config['general']['log_date_format']
)
ch.setFormatter(formatter)
logger.addHandler(ch)
if args.daily:
archiver = Archiver(vars(args), config)
userP = Process(target=archiver.log_users)
......
......@@ -14,6 +14,7 @@ archiver = archive_data.Archiver(
yaml.load(open(config), Loader=yaml.BaseLoader)
)
def test_log_users():
archiver.log_users()
logfile = archiver.data_dir + '/user.csv'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment