'return a list of hostnames for a pattern'

def list_hosts(self, pattern='all'):

    result = [h for h in self.get_hosts(pattern)]
    if ((len(result) == 0) and (pattern in C.LOCALHOST)):
        result = [pattern]
    return result
