def ui_command_tag(self, wwn_or_tag, new_tag):
    "\n        Tag a NodeACL.\n\n        Usage: tag <wwn_or_tag> <new_tag>\n\n        Tags help manage initiator WWNs. A tag can apply to one or\n        more WWNs. This can give a more meaningful name to a single\n        initiator's configuration, or allow multiple initiators with\n        identical settings to be configured en masse.\n\n        The WWNs described by <wwn_or_tag> will be given the new\n        tag. If new_tag already exists, its new members will adopt the\n        current tag's configuration.\n\n        Within a tag, the 'info' command shows the WWNs the tag applies to.\n\n        Use 'untag' to remove tags.\n\n        NOTE: tags are only supported in kernel 3.8 and above.\n        "
    if (wwn_or_tag == new_tag):
        return
    if ('.' in new_tag):
        self.shell.log.error("'.' not permitted in tag names.")
        return
    src = list(self.find_tagged(wwn_or_tag))
    if (not src):
        self.shell.log.error(('wwn_or_tag %s not found.' % wwn_or_tag))
        return
    old_tag_members = list(self.find_tagged(new_tag))
    src_wwns = [na.node_wwn for na in src]
    old_tag_members = [old for old in old_tag_members if (old.node_wwn not in src_wwns)]
    for na in src:
        na.tag = new_tag
        if old_tag_members:
            model = old_tag_members[0]
            for mlun in na.mapped_luns:
                mlun.delete()
            for mlun in model.mapped_luns:
                MappedLUN(na, mlun.mapped_lun, mlun.tpg_lun, mlun.write_protect)
            if self.parent.rtsnode.has_feature('auth'):
                for param in auth_params:
                    setattr(na, ('chap_' + param), getattr(model, ('chap_' + param)))
            for item in model.list_attributes(writable=True):
                na.set_attribute(item, model.get_attribute(item))
            for item in model.list_parameters(writable=True):
                na.set_parameter(item, model.get_parameter(item))
    self.refresh()
Tag a NodeACL.

Usage: tag <wwn_or_tag> <new_tag>

Tags help manage initiator WWNs. A tag can apply to one or
more WWNs. This can give a more meaningful name to a single
initiator's configuration, or allow multiple initiators with
identical settings to be configured en masse.

The WWNs described by <wwn_or_tag> will be given the new
tag. If new_tag already exists, its new members will adopt the
current tag's configuration.

Within a tag, the 'info' command shows the WWNs the tag applies to.

Use 'untag' to remove tags.

NOTE: tags are only supported in kernel 3.8 and above.
def ui_command_tag(self, wwn_or_tag, new_tag):
    "\n        Tag a NodeACL.\n\n        Usage: tag <wwn_or_tag> <new_tag>\n\n        Tags help manage initiator WWNs. A tag can apply to one or\n        more WWNs. This can give a more meaningful name to a single\n        initiator's configuration, or allow multiple initiators with\n        identical settings to be configured en masse.\n\n        The WWNs described by <wwn_or_tag> will be given the new\n        tag. If new_tag already exists, its new members will adopt the\n        current tag's configuration.\n\n        Within a tag, the 'info' command shows the WWNs the tag applies to.\n\n        Use 'untag' to remove tags.\n\n        NOTE: tags are only supported in kernel 3.8 and above.\n        "
    if (wwn_or_tag == new_tag):
        return
    if ('.' in new_tag):
        self.shell.log.error("'.' not permitted in tag names.")
        return
    src = list(self.find_tagged(wwn_or_tag))
    if (not src):
        self.shell.log.error(('wwn_or_tag %s not found.' % wwn_or_tag))
        return
    old_tag_members = list(self.find_tagged(new_tag))
    src_wwns = [na.node_wwn for na in src]
    old_tag_members = [old for old in old_tag_members if (old.node_wwn not in src_wwns)]
    for na in src:
        na.tag = new_tag
        if old_tag_members:
            model = old_tag_members[0]
            for mlun in na.mapped_luns:
                mlun.delete()
            for mlun in model.mapped_luns:
                MappedLUN(na, mlun.mapped_lun, mlun.tpg_lun, mlun.write_protect)
            if self.parent.rtsnode.has_feature('auth'):
                for param in auth_params:
                    setattr(na, ('chap_' + param), getattr(model, ('chap_' + param)))
            for item in model.list_attributes(writable=True):
                na.set_attribute(item, model.get_attribute(item))
            for item in model.list_parameters(writable=True):
                na.set_parameter(item, model.get_parameter(item))
    self.refresh()