'fetch host object using name
deal with implicit localhost
and possible inconsistent inventory'

def get_host(self, hostname):

    matching_host = self.hosts.get(hostname, None)
    if (matching_host is None):
        if (hostname in C.LOCALHOST):
            matching_host = self._create_implicit_localhost(hostname)
        if (matching_host is None):
            matching_host = self._scan_groups_for_host(hostname)
        if matching_host:
            self.hosts[hostname] = matching_host
    return matching_host
