'Make sure a tagname really is unused, unless we have a parent'

def _unique_tag_name(self, tagname):

    if self.my_config.discovery.parent_tag:
        return tagname
    (tagnameN, count) = (tagname, 2)
    while self.session.config.get_tags(tagnameN):
        tagnameN = ('%s    (%s)' % (tagname, count))
        count += 1
    return tagnameN
