"""
CpuVulnsAll - combiner for cpu vulnerabilities:
===============================================

cpu vulnerabilities includes:
    * CpuVulnsAll - file /sys/devices/system/cpu/vulnerabilities/*

Examples:
    >>> type(cvb)
    <class 'insights.combiners.cpu_vulns_all.CpuVulnsAll'>
    >>> list(cvb.keys())
    ['meltdown', 'spectre_v1']

Raises:
    SkipComponent: Not available data

"""

from insights.core.plugins import combiner
from insights.parsers.cpu_vulns import CpuVulns
from insights.parsers import SkipComponent


@combiner(CpuVulns)
class CpuVulnsAll(dict):
    """
    This combiner provides an interface to CPU vulnerabilities parsers.
    """

    def __init__(self, cpu_vulns):
        for cv in cpu_vulns:
            self.update({cv.file_name: cv.value}) if cv.file_name else None
        if len(self) == 0:
            raise SkipComponent('Not available data')

@@ -24,19 +24,19 @@
 ner for 
-cpu
+CPU
  vulnera
@@ -47,11 +47,9 @@
 ties
-:%0A=
+%0A
 ====
@@ -96,296 +96,98 @@
 ==%0A%0A
-cpu vulnerabilities includes:%0A    * CpuVulnsAll - file /sys/devices/system/cpu/vulnerabilities/*%0A%0AExamples:%0A    %3E%3E%3E type(cvb)%0A    %3Cclass 'insights.combiners.cpu_
+This combiner provides an interface to CPU vulnerabilities parsers for cpu 
 vuln
-s_all.CpuVulnsAll'%3E%0A    %3E%3E%3E list(cvb.keys())%0A    %5B'meltdown', 'spectre_v1'%5D%0A%0ARaises:%0A    SkipComponent: Not available data%0A
+erabilities
 %0A%22%22%22
@@ -385,75 +385,723 @@
     
-This combiner provides an interface to CPU vulnerabilities parsers.
+Class to capsulate the parsers of cpu_vulns, files information will be%0A    stored in a list of dictionaries, each dictionary is for one file, the%0A    dictionary key is the file name, dictionary value is the file content.%0A%0A    Sample output for files:%0A        %60%60/sys/devices/system/cpu/vulnerabilities/spectre_v1%60%60:%0A            Mitigation: Load fences%0A%0A        %60%60/sys/devices/system/cpu/vulnerabilities/meltdown%60%60:%0A            Mitigation: PTI%0A%0A    Examples:%0A        %3E%3E%3E type(cvb)%0A        %3Cclass 'insights.combiners.cpu_vulns_all.CpuVulnsAll'%3E%0A        %3E%3E%3E list(cvb.keys())%0A        %5B'meltdown', 'spectre_v1'%5D%0A        %3E%3E%3E cvb%5B'meltdown'%5D%0A        'Mitigation: PTI'%0A%0A    Raises:%0A        SkipComponent: Not available data%0A
 %0A   

Enhance document for combiner of cpu_vulns_all (#2274)