'Get or create worker by hostname.
Returns:
Tuple: of ``(worker, was_created)`` pairs.'

def get_or_create_worker(self, hostname, **kwargs):

    try:
        worker = self.workers[hostname]
        if kwargs:
            worker.update(kwargs)
        return (worker, False)
    except KeyError:
        worker = self.workers[hostname] = self.Worker(hostname, **kwargs)
        return (worker, True)
