'Takes a list of hosts and a (start,end) tuple and returns the subset of
hosts based on the subscript (which may be None to return all hosts).'

def _apply_subscript(self, hosts, subscript):

    if ((not hosts) or (not subscript)):
        return hosts
    (start, end) = subscript
    if end:
        if (end == (-1)):
            end = (len(hosts) - 1)
        return hosts[start:(end + 1)]
    else:
        return [hosts[start]]
