def _get_tags(data):
    ret = {}
    distro = __grains__.get('osfinger')
    for audit_dict in data.get('sysctl', []):
        for audit_id, audit_data in audit_dict.iteritems():
            tags_dict = audit_data.get('data', {})
            tags = tags_dict.get(distro, [])
            if isinstance(tags, dict):
                # malformed yaml, convert to list of dicts
                tmp = []
                for name, tag in tags.iteritems():
                    tmp.append({name: tag})
                tags = tmp
            for item in tags:
                for name, tag in item.iteritems():
                    if isinstance(tag, dict):
                        tag_data = copy.deepcopy(tag)
                        tag = tag_data.pop('tag')
                    if tag not in ret:
                        ret[tag] = []
                    formatted_data = {'name': name,
                                      'tag': tag,
                                      'module': 'sysctl'}
                    formatted_data.update(tag_data)
                    formatted_data.update(audit_data)
                    formatted_data.pop('data')
                    ret[tag].append(formatted_data)
    return ret
Release lock on media list items
dataset/ETHPy150Open HubbleStack/Nova/hubblestack_nova/sysctl.py/_get_tags--crossover with--dataset/ETHPy150Open disqus/playa/playa/lib/vlc.py/MediaList.unlock