in hostfactory/host_provider/src/util.py [0:0]
def __init__(self, name, directory, formatted=False):
assert name not in ['hosts.json', 'requests.json'], "Illegal json name."
self.path = os.path.join(directory, name)
self.lockpath = self.path + ".lock"
if not os.path.exists(self.lockpath):
with open(self.lockpath, "a"):
pass
self.formatted = formatted
self.data = None
self.lockfp = None
self.lock_count = 0
self.logger = init_logging()