def add_lock(self, args):
        timestamp = datetime.now().strftime('%Y%m%d-%H%M%S')
        lock_info = {
            'time': timestamp,
            'user': self.conf.config['user.name'],
        }
        try:
            f = open(self._lock_file, 'w+')
            f.write(json.dumps(lock_info))
            f.close()
        except (OSError, __HOLE__):
            raise LockDriverError('Failed to write lock file', 1)
dataset/ETHPy150Open trebuchet-deploy/trigger/trigger/drivers/trebuchet/local.py/LockDriver.add_lock