mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 09:27:31 -02:30
modularization of inventory_import command
This separates file parsing logic that was mixed in with other important code inside of the inventory import command. The logic around MemObject data structures was moved to utils, and the file parsing was moved to a legacy module. As of this commit, that module can operate within the Tower environment but it will be removed. Also refactor the loggers to fix old bug and work inside of the different contexts - the Loader classes, mem objects, and hopefully the inventory modules eventually.
This commit is contained in:
@@ -5,6 +5,16 @@ from logstash.formatter import LogstashFormatterVersion1
|
||||
from copy import copy
|
||||
import json
|
||||
import time
|
||||
import logging
|
||||
|
||||
|
||||
class TimeFormatter(logging.Formatter):
|
||||
'''
|
||||
Custom log formatter used for inventory imports
|
||||
'''
|
||||
def format(self, record):
|
||||
record.relativeSeconds = record.relativeCreated / 1000.0
|
||||
return logging.Formatter.format(self, record)
|
||||
|
||||
|
||||
class LogstashFormatter(LogstashFormatterVersion1):
|
||||
|
||||
Reference in New Issue
Block a user