def tags_to_dict(tags, delimiter='='):
        """

        :param tags: tags string
        :param delimiter:
        :return: dict key:value
        """
        tags_dict = {}
        for t in tags:
            if delimiter in t:
                splitted_tag = t.split(delimiter)
                if len(splitted_tag) != 2:
                    raise SergentSshException('invalid tag format %s : must be tag_name=tag_value' % t)
                tags_dict['tag:' + splitted_tag[0]] = splitted_tag[1]
            else:
                tags_dict['tag-key'] = t

        return tags_dict
def tags_to_dict ( tags , delimiter = '=' ) : tags_dict = { } for t in tags : if delimiter in t : splitted_tag = t . split ( delimiter ) if len ( splitted_tag ) != 2 : raise SergentSshException ( 'invalid tag format %s : must be tag_name=tag_value' % t ) tags_dict [ 'tag:' + splitted_tag [ 0 ] ] = splitted_tag [ 1 ] else : tags_dict [ 'tag-key' ] = t return tags_dict
:param tags: tags string
        :param delimiter:
        :return: dict key:value