def __enter__(self):
    try:
        fcntl.flock(self.fd, (fcntl.LOCK_EX | fcntl.LOCK_NB))
    except Exception:
        raise error.Error(('Unable to acquire lock (%s): Is webports already running?' % self.file_name))
def __enter__(self):
    try:
        fcntl.flock(self.fd, (fcntl.LOCK_EX | fcntl.LOCK_NB))
    except Exception:
        raise error.Error(('Unable to acquire lock (%s): Is webports already running?' % self.file_name))