internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: RedHatInsights/insights-core

Issue:
Missing endscript in logrotate_conf parser causes infinite loop
If a script tag in a logrotate config file doesn't have a corresponding endscript tag, the parser loops forever and eventually consumes all system memory.


Discussion:

Resolving patch:
diff --git a/insights/combiners/logrotate_conf.py b/insights/combiners/logrotate_conf.py
--- a/insights/combiners/logrotate_conf.py
+++ b/insights/combiners/logrotate_conf.py
@@ -159,8 +159,8 @@ def __init__(self, ctx):
         ScriptStart = WS >> PosMarker(Choice([Literal(s) for s in scripts])) << WS
         ScriptEnd = Literal("endscript")
         Line = (WS >> AnyChar.until(EOL) << WS).map(lambda x: "".join(x))
-        Lines = Line.until(ScriptEnd).map(lambda x: "\n".join(x))
-        Script = ScriptStart + Lines << ScriptEnd
+        Lines = Line.until(ScriptEnd | EOF).map(lambda x: "\n".join(x))
+        Script = ScriptStart + Lines << Opt(ScriptEnd)
         Script = Script.map(lambda x: [x[0], [x[1]], None])
         BeginBlock = WS >> LeftCurly << WS
         EndBlock = WS >> RightCurly
@@ -172,7 +172,7 @@ def __init__(self, ctx):
         Stanza <= WS >> (Stmt | Comment) << WS
         Doc = Many(Stanza).map(skip_none).map(self.to_entries)
 
-        self.Top = Doc + EOF
+        self.Top = Doc << EOF
 
     def to_entries(self, x):
         ret = []
@@ -194,7 +194,7 @@ def parse_doc(content, ctx=None):
     if isinstance(content, list):
         content = "\n".join(content)
     parse = DocParser(ctx)
-    result = parse(content)[0]
+    result = parse(content)
     return Entry(children=result, src=ctx)
 
 


Test patch:
diff --git a/insights/combiners/tests/test_logrotate_conf_tree.py b/insights/combiners/tests/test_logrotate_conf_tree.py
--- a/insights/combiners/tests/test_logrotate_conf_tree.py
+++ b/insights/combiners/tests/test_logrotate_conf_tree.py
@@ -1,4 +1,6 @@
 # coding=utf-8
+import pytest
+
 from insights.parsr.query import first
 from insights.combiners.logrotate_conf import _LogRotateConf, LogRotateConfTree
 from insights.tests import context_wrap
@@ -66,6 +68,22 @@
 """.strip()
 
 
+LOGROTATE_MISSING_ENDSCRIPT = """
+/var/log/example/*.log {
+  daily
+  missingok
+  rotate 10
+  dateext
+  dateyesterday
+  notifempty
+  sharedscripts
+  postrotate
+    [ ! -f /var/run/openresty.pid ] || kill -USR1 `cat /var/run/example.pid`
+    /usr/local/bin/mc cp $1 minio/matrix-prod-cluster/node1/example/
+}
+""".strip()
+
+
 def test_logrotate_tree():
     p = _LogRotateConf(context_wrap(CONF, path="/etc/logrotate.conf"))
     conf = LogRotateConfTree([p])
@@ -82,3 +100,9 @@ def test_junk_space():
     p = _LogRotateConf(context_wrap(JUNK_SPACE, path="/etc/logrotate.conf"))
     conf = LogRotateConfTree([p])
     assert "compress" in conf["/var/log/spooler"]
+
+
+def test_logrotate_conf_combiner_missing_endscript():
+    with pytest.raises(Exception):
+        p = _LogRotateConf(context_wrap(LOGROTATE_MISSING_ENDSCRIPT, path='/etc/logrotate.conf')),
+        print(p)
Repository: RedHatInsights/insights-core

Issue:
The dmsetup parser is raising ValueError exceptions in production
The DmsetupStatus parser is throwing a large number of the exception ValueError('not enough values to unpack (expected 2, got 1)',) in production.


Discussion:

Resolving patch:
diff --git a/insights/parsers/dmsetup.py b/insights/parsers/dmsetup.py
--- a/insights/parsers/dmsetup.py
+++ b/insights/parsers/dmsetup.py
@@ -189,6 +189,9 @@ class DmsetupStatus(CommandParser, list):
 
     def parse_content(self, content):
         self.unparseable_lines = []
+        if content[0].lower() == "no devices found":
+            return
+
         for line in content:
             _device_name, _device_info_str = line.rsplit(':', 1)
             device_name = _device_name.strip()


Test patch:
diff --git a/insights/parsers/tests/test_dmsetup.py b/insights/parsers/tests/test_dmsetup.py
--- a/insights/parsers/tests/test_dmsetup.py
+++ b/insights/parsers/tests/test_dmsetup.py
@@ -105,6 +105,10 @@ def test_dmsetup_setupinfo():
 docker-253:10-1234567-0df13579: 0 20971520 thin 1922048
 """.strip()
 
+DMSETUP_STATUS_3 = """
+No devices found
+""".strip()
+
 
 def test_dmsetup_status():
     r = DmsetupStatus(context_wrap(DMSETUP_STATUS_1))
@@ -165,6 +169,10 @@ def test_dmsetup_status():
             'rootvg-docker--pool: 0 129548288 thin-pool 1 20/49152 38/126512 - rw no_discard_passdown queue_if_no_space',
             'docker-253:10-1234567-0df13579: 0 20971520 thin 1922048']
 
+    r = DmsetupStatus(context_wrap(DMSETUP_STATUS_3))
+    assert len(r) == 0
+    assert r.unparseable_lines == []
+
 
 DMSETUP_EXAMPLES = """
 Name               Maj Min Stat Open Targ Event  UUID
Repository: RedHatInsights/insights-core

Issue:
The virsh_list_all parser is raising ValueError exceptions in production
The VirshListAll parser is throwing a large number of the exception ValueError("Line containing 'Id,Name,State' was not found in table",) in production.


Discussion:

Resolving patch:
diff --git a/insights/parsers/virsh_list_all.py b/insights/parsers/virsh_list_all.py
--- a/insights/parsers/virsh_list_all.py
+++ b/insights/parsers/virsh_list_all.py
@@ -76,6 +76,10 @@ def parse_content(self, content):
         self.fields = []
         self.cols = []
         self.keywords = []
+        # Check and remove any error message, or empty lines. This to
+        # prevent any ValueError exceptions when parse_fixed_table is
+        # called below.
+        content = [l for l in content if not l.startswith("error: ") and l != ""]
         if not content:
             return
 


Test patch:
diff --git a/insights/parsers/tests/test_virsh_list_all.py b/insights/parsers/tests/test_virsh_list_all.py
--- a/insights/parsers/tests/test_virsh_list_all.py
+++ b/insights/parsers/tests/test_virsh_list_all.py
@@ -7,6 +7,12 @@
 BLANK = """
 """.strip()
 
+ERROR = """
+error: Failed to reconnect to the hypervisor
+error: no valid connection
+error: internal error Unable to locate libvirtd daemon in /usr/sbin (to override, set $LIBVIRTD_PATH to the name of the libvirtd binary)
+""".strip()
+
 NO_RESULT = """
  Id    Name                           State
 ----------------------------------------------------
@@ -31,6 +37,13 @@
 """.strip()
 
 
+def assert_if_none(output):
+    assert output.fields == []
+    assert output.cols == []
+    assert output.keywords == []
+    assert output.get_vm_state('NORHEL') is None
+
+
 def test_virsh_output():
     output = virsh_list_all.VirshListAll(context_wrap(OUTPUT))
     assert len(output.search(state='shut off')) == 11
@@ -45,19 +58,15 @@ def test_virsh_output():
 
 
 def test_virsh_output_no_vms():
-    output = virsh_list_all.VirshListAll(context_wrap(NO_RESULT))
-    assert output.fields == []
-    assert output.cols == []
-    assert output.keywords == []
-    assert output.get_vm_state('NORHEL') is None
+    assert_if_none(virsh_list_all.VirshListAll(context_wrap(NO_RESULT)))
 
 
 def test_virsh_output_blank():
-    output = virsh_list_all.VirshListAll(context_wrap(BLANK))
-    assert output.fields == []
-    assert output.cols == []
-    assert output.keywords == []
-    assert output.get_vm_state('NORHEL') is None
+    assert_if_none(virsh_list_all.VirshListAll(context_wrap(BLANK)))
+
+
+def test_virsh_output_error():
+    assert_if_none(virsh_list_all.VirshListAll(context_wrap(ERROR)))
 
 
 def test_virsh_list_all_documentation():
Repository: RedHatInsights/insights-core

Issue:
Uname cannot recognize the redhat_release correctly for non-x86 kernel
For the kernel of non-x86 arch, there are the following kernel versions which didn't follow the RHEL [Release](https://access.redhat.com/articles/3078)

- kernel-4.14.0-49.el7a.ppc64le
- kernel-4.14.0-115.10.1.el7a.ppc64le

Better resolve this issue in the Uname parser.



Discussion:

Resolving patch:
diff --git a/insights/parsers/uname.py b/insights/parsers/uname.py
--- a/insights/parsers/uname.py
+++ b/insights/parsers/uname.py
@@ -101,6 +101,12 @@
     "3.10.0-1062": "7.7",
     "3.10.0-1127": "7.8",
     "3.10.0-1160": "7.9",
+    # Added alt to the below 3 kernel entries since they're part of the
+    # kernel-alt pkg, if we don't it would create duplicate entries and
+    # mess with what's returned by from_release.
+    "4.11.0-44": "7.4.alt",
+    "4.14.0-49": "7.5.alt",
+    "4.14.0-115": "7.6.alt",
     "4.18.0-80": "8.0",
     "4.18.0-147": "8.1",
     "4.18.0-193": "8.2",


Test patch:
diff --git a/insights/parsers/tests/test_uname.py b/insights/parsers/tests/test_uname.py
--- a/insights/parsers/tests/test_uname.py
+++ b/insights/parsers/tests/test_uname.py
@@ -258,6 +258,18 @@ def test_from_release():
     from_nvr = uname.Uname.from_kernel("2.6.32-358")
     assert str(from_release) == str(from_nvr)
 
+    # Test the regular 7.4 version.
+    release = ("7", "4")
+    from_release = uname.Uname.from_release(release)
+    from_nvr = uname.Uname.from_kernel("3.10.0-693")
+    assert str(from_release) == str(from_nvr)
+
+    # Test the kernel-alt 7.4 version.
+    release = ("7", "4", "alt")
+    from_release = uname.Uname.from_release(release)
+    from_nvr = uname.Uname.from_kernel("4.11.0-44")
+    assert str(from_release) == str(from_nvr)
+
     unknown_list = ["2.4.21-3", "2.6.9-4", "2.6.18-7", "2.6.32-70", "3.10.0-53"]
     known_list = [{'version': "2.4.21-4", 'rhel_release': ["3", "0"]},
                   {'version': "2.6.9-55", 'rhel_release': ["4", "5"]},
Repository: RedHatInsights/insights-core

Issue:
The smt combiner is raising IndexError exceptions in production.
The CpuTopology combiner is throwing a large number of the exception IndexError('list index out of range',) in production.


Discussion:

Resolving patch:
diff --git a/insights/combiners/smt.py b/insights/combiners/smt.py
--- a/insights/combiners/smt.py
+++ b/insights/combiners/smt.py
@@ -43,7 +43,13 @@ def __init__(self, cpu_online, cpu_siblings):
         max_cpu_core_id = max([core.core_id for core in cpu_online])
         for n in range(max_cpu_core_id + 1):
             online = [core for core in cpu_online if core.core_id == n]
-            online = online[0].on
+            # On some boxes cpu0 doesn't have the online file, since technically cpu0 will always
+            # be online. So check if online returns anything before trying to access online[0].
+            # If it returns nothing and n is 0 set online to True.
+            if online:
+                online = online[0].on
+            elif not online and n == 0:
+                online = True
             siblings = [sibling for sibling in cpu_siblings if sibling.core_id == n]
             if len(siblings) != 0:
                 siblings = siblings[0].siblings


Test patch:
diff --git a/insights/combiners/tests/test_smt.py b/insights/combiners/tests/test_smt.py
--- a/insights/combiners/tests/test_smt.py
+++ b/insights/combiners/tests/test_smt.py
@@ -142,3 +142,20 @@ def test_doc_examples(cpu_all_online):
     }
     failed, total = doctest.testmod(smt, globs=env)
     assert failed == 0
+
+
+def test_without_hyperthreading_all_online_missing_cpu0_online_file():
+    online = [
+        CpuCoreOnline(context_wrap("1", path=ONLINE_PATH.format(1))),
+    ]
+    siblings = [
+        CpuSiblings(context_wrap("0", path=SIBLINGS_PATH.format(0))),
+        CpuSiblings(context_wrap("1", path=SIBLINGS_PATH.format(1)))
+    ]
+
+    cpu_topology = CpuTopology(online, siblings)
+    assert cpu_topology.online(0)
+    assert cpu_topology.siblings(0) == [0]
+    assert cpu_topology.online(1)
+    assert cpu_topology.siblings(1) == [1]
+    assert cpu_topology.all_solitary
Repository: RedHatInsights/insights-core

Issue:
The docker_list parser is raising ValueError exceptions in production.
The DockerList parser is throwing a number of the exception ValueError("Line containing 'REPOSITORY' was not found in table",), and ValueError("Line containing 'CONTAINER' was not found in table",) in production.


Discussion:

Resolving patch:
diff --git a/insights/parsers/docker_list.py b/insights/parsers/docker_list.py
--- a/insights/parsers/docker_list.py
+++ b/insights/parsers/docker_list.py
@@ -61,6 +61,12 @@ def parse_content(self, content):
         if not (self.key_field and self.attr_name):
             raise NotImplementedError("'key_field' or 'attr_name' is not defined")
 
+        # There is another application named docker that's a kde system tray, that
+        # will output help when the spec is run due to incorrect arguments. So check
+        # the content for any lines starting with Usage: so it can be skipped.
+        if any(l for l in content if l.startswith("Usage: ")):
+            raise SkipException('No data only help output.')
+
         self.rows = parse_fixed_table(content,
                                       heading_ignore=self.heading_ignore,
                                       header_substitute=self.substitutions)


Test patch:
diff --git a/insights/parsers/tests/test_docker_list.py b/insights/parsers/tests/test_docker_list.py
--- a/insights/parsers/tests/test_docker_list.py
+++ b/insights/parsers/tests/test_docker_list.py
@@ -23,6 +23,15 @@
 REPOSITORY                           TAG                 DIGEST              IMAGE ID                                                           CREATED             VIRTUAL SIZE
 """
 
+DOCKER_HELP_OUTPUT = """
+/usr/bin/docker - version 1.5
+
+Usage: /usr/bin/docker [OPTIONS]
+
+Options:
+  -help             Show this help.
+"""
+
 
 def test_docker_list_images():
     result = docker_list.DockerListImages(context_wrap(DOCKER_LIST_IMAGES))
@@ -74,6 +83,16 @@ def test_docker_list_images_no_data():
     assert 'No data.' in str(ex)
 
 
+def test_docker_list_images_help_output():
+    with pytest.raises(SkipException) as ex:
+        docker_list.DockerListImages(context_wrap(DOCKER_HELP_OUTPUT))
+    assert 'No data only help output.' in str(ex)
+
+    with pytest.raises(SkipException) as ex:
+        docker_list.DockerListContainers(context_wrap(DOCKER_HELP_OUTPUT))
+    assert 'No data only help output.' in str(ex)
+
+
 def test_undefined_key_field():
     with pytest.raises(NotImplementedError):
         assert docker_list.DockerList(context_wrap(DOCKER_LIST_CONTAINERS)).key_field is None
Repository: RedHatInsights/insights-core

Issue:
Add an option to force colored output to insights run command
When "pipping" the output of `insights run` to `less`, the colors are missing, even using `less -r`.

Several linux commands has the ability to force a colored output with `--color=always`, for example:
~~~
git diff --color=always | less -r
ls -l --color=always | less -r
grep test . --color=always | less -r 
~~~

Add an option to insights to force the color even when the output is "pipped".


Discussion:

Resolving patch:
diff --git a/insights/__init__.py b/insights/__init__.py
--- a/insights/__init__.py
+++ b/insights/__init__.py
@@ -56,6 +56,8 @@
 for name in package_info:
     package_info[name] = pkgutil.get_data(__name__, name).strip().decode("utf-8")
 
+_COLOR = "auto"
+
 
 def get_nvr():
     return "{0}-{1}-{2}".format(package_info["NAME"],
@@ -263,6 +265,8 @@ def run(component=None, root=None, print_summary=False,
         p.add_argument("--tags", help="Expression to select rules by tag.")
         p.add_argument("-D", "--debug", help="Verbose debug output.", action="store_true")
         p.add_argument("--context", help="Execution Context. Defaults to HostContext if an archive isn't passed.")
+        p.add_argument("--color", default="auto", choices=["always", "auto", "never"], metavar="[=WHEN]",
+                       help="Choose if and how the color encoding is outputted. When is 'always', 'auto', or 'never'.")
 
         class Args(object):
             pass
@@ -270,6 +274,8 @@ class Args(object):
         formatters = []
         args = Args()
         p.parse_known_args(namespace=args)
+        global _COLOR
+        _COLOR = args.color
         p = argparse.ArgumentParser(parents=[p])
         args.format = "insights.formats._json" if args.format == "json" else args.format
         args.format = "insights.formats._yaml" if args.format == "yaml" else args.format
diff --git a/insights/formats/text.py b/insights/formats/text.py
--- a/insights/formats/text.py
+++ b/insights/formats/text.py
@@ -6,14 +6,30 @@
 
 from pprint import pprint
 from six import StringIO
-from insights import dr, datasource, rule, condition, incident, parser
+from insights import _COLOR, dr, datasource, rule, condition, incident, parser
 from insights.core.context import ExecutionContext
 from insights.formats import Formatter, FormatterAdapter, render
 
 
 try:
-    from colorama import Fore, Style, init
-    init()
+    from colorama import init
+
+    if _COLOR == "always":
+        from colorama import Fore, Style
+        init(strip=False)
+    elif _COLOR == "auto":
+        from colorama import Fore, Style
+        init()
+    elif _COLOR == "never":
+        class Default(type):
+            def __getattr__(*args):
+                return ""
+
+        class Fore(six.with_metaclass(Default)):
+            pass
+
+        class Style(six.with_metaclass(Default)):
+            pass
 except ImportError:
     print("Install colorama if console colors are preferred.")
 


Test patch:
Repository: RedHatInsights/insights-core

Issue:
Duplicated "curl" in spec gcp_license_codes
https://github.com/RedHatInsights/insights-core/blob/bee093a5f5967d00204e002be5c5b71b91a11d04/insights/specs/default.py#L436

I believe the second "curl" is a duplicated one in this command, which might result in command failure.

The correct and complete command should be:

```
/usr/bin/curl -s -H 'Metadata-Flavor: Google' http://metadata.google.internal/computeMetadata/v1/instance/licenses/?recursive=True --connect-timeout 5
```


Discussion:

Resolving patch:
diff --git a/insights/specs/default.py b/insights/specs/default.py
--- a/insights/specs/default.py
+++ b/insights/specs/default.py
@@ -433,7 +433,7 @@ def is_gcp(broker):
             return True
         raise SkipComponent()
 
-    gcp_license_codes = simple_command("/usr/bin/curl -s curl -H Metadata-Flavor: Google http://metadata.google.internal/computeMetadata/v1/instance/licenses/?recursive=True --connect-timeout 5", deps=[is_gcp])
+    gcp_license_codes = simple_command("/usr/bin/curl -s -H 'Metadata-Flavor: Google' http://metadata.google.internal/computeMetadata/v1/instance/licenses/?recursive=True --connect-timeout 5", deps=[is_gcp])
     greenboot_status = simple_command("/usr/libexec/greenboot/greenboot-status")
     grub_conf = simple_file("/boot/grub/grub.conf")
     grub_config_perms = simple_command("/bin/ls -l /boot/grub2/grub.cfg")  # only RHEL7 and updwards


Test patch:
Repository: RedHatInsights/insights-core

Issue:
The CloudProvider combiner misidentifies systems that happen to have UUID prefix "ec2" as AWS
Systems that aren't in AWS but just happen to have "ec2" as the UUID prefix are misidentified.


Discussion:

Resolving patch:
diff --git a/insights/combiners/cloud_provider.py b/insights/combiners/cloud_provider.py
--- a/insights/combiners/cloud_provider.py
+++ b/insights/combiners/cloud_provider.py
@@ -235,10 +235,12 @@ def __init__(self, *args, **kwargs):
         self.rpm = 'rh-amazon-rhui-client'
         self.bios_vendor_version = 'amazon'
         self.uuid = 'ec2'
+        self.asset_tag = 'Amazon EC2'
         self.cp_bios_vendor = self._get_cp_bios_vendor(self.bios_vendor_version)
         self.cp_bios_version = self._get_cp_bios_version(self.bios_vendor_version)
         self.cp_rpms = self._get_rpm_cp_info(self.rpm)
         self.cp_uuid = self._get_cp_from_uuid(self.uuid)
+        self.cp_asset_tag = self._get_cp_from_asset_tag(self.asset_tag)
 
 
 class AzureCloudProvider(CloudProviderInstance):
@@ -387,7 +389,7 @@ def _select_provider(self):
         if self._cp_objects[self.AZURE].cp_yum or self._cp_objects[self.AZURE].cp_asset_tag:
             return self.AZURE
 
-        if self._cp_objects[self.AWS].cp_uuid:
+        if self._cp_objects[self.AWS].cp_uuid and self._cp_objects[self.AWS].cp_asset_tag:
             return self.AWS
 
         if self._cp_objects[self.ALIBABA].cp_manufacturer:


Test patch:
diff --git a/insights/combiners/tests/test_cloud_provider.py b/insights/combiners/tests/test_cloud_provider.py
--- a/insights/combiners/tests/test_cloud_provider.py
+++ b/insights/combiners/tests/test_cloud_provider.py
@@ -209,7 +209,7 @@
 \tProduct Name: X9SCL/X9SCM
 \tVersion: 0123456789
 \tSerial Number: 0123456789
-\tUUID: 12345678-1234-1234-1234-123456681234
+\tUUID: EC245678-1234-1234-1234-123456681234
 \tWake-up Type: Power Switch
 \tSKU Number: To be filled by O.E.M.
 \tFamily: To be filled by O.E.M.
@@ -313,7 +313,7 @@
 \tLock: Not Present
 \tVersion: Not Specified
 \tSerial Number: Not Specified
-\tAsset Tag: Not Specified
+\tAsset Tag: Amazon EC2
 \tBoot-up State: Safe
 \tPower Supply State: Safe
 \tThermal State: Safe
@@ -666,6 +666,15 @@ def test__uuid():
     assert ret.cp_uuid[CloudProvider.AWS] == 'EC2F58AF-2DAD-C57E-88C0-A81CB6084290'
 
 
+def test__uuid_not_aws():
+    irpms = IRPMS(context_wrap(RPMS))
+    dmi = DMIDecode(context_wrap(DMIDECODE_BARE_METAL))
+    yrl = YumRepoList(context_wrap(YUM_REPOLIST_NOT_AZURE))
+    ret = CloudProvider(irpms, dmi, yrl, None)
+    assert ret.cloud_provider is None
+    assert ret.cp_uuid[CloudProvider.AWS] == 'EC245678-1234-1234-1234-123456681234'
+
+
 def test_dmidecode_alibaba():
     irpms = IRPMS(context_wrap(RPMS))
     dmi = DMIDecode(context_wrap(DMIDECODE_ALIBABA))
Repository: RedHatInsights/insights-core

Issue:
The modprobe combiner is raising AttributeError exceptions in production.
The AllModProbe combiner is throwing a number of the exception AttributeError("'bool' object has no attribute 'append'",) in production.


Discussion:

Resolving patch:
diff --git a/insights/combiners/modprobe.py b/insights/combiners/modprobe.py
--- a/insights/combiners/modprobe.py
+++ b/insights/combiners/modprobe.py
@@ -82,7 +82,7 @@ def __init__(self, modprobe):
                 if section not in self.data:
                     self.data[section] = {}
                 for name, value in sectdict.items():
-                    if name in self.data[section]:
+                    if name in self.data[section] and type(self.data[section][name][0]) == list:
                         # append to this module's value - should only
                         # happen for aliases.
                         self.data[section][name][0].append(value)


Test patch:
diff --git a/insights/combiners/tests/test_modprobe.py b/insights/combiners/tests/test_modprobe.py
--- a/insights/combiners/tests/test_modprobe.py
+++ b/insights/combiners/tests/test_modprobe.py
@@ -5,6 +5,9 @@
 MOD_OPTION_INFO = """
 options ipv6 disable=1
 install ipv6 /bin/true
+
+# Test duplicate entry.
+blacklist vfat
 """
 
 MOD_OPTION_INFO_PATH = "/etc/modprobe.d/ipv6.conf"
@@ -38,6 +41,9 @@
 alias
 alias scsi_hostadapter2 ata_piix failed comment
 balclkist ieee80211
+
+# Test duplicate entry.
+blacklist vfat
 """
 
 MOD_COMPLETE_PATH = "/etc/modprobe.conf"
@@ -59,6 +65,7 @@ def test_all_modprobe():
     assert 'blacklist' in all_data
     assert all_data['blacklist'] == {
         'i8xx_tco': ModProbeValue(value=True, source=MOD_COMPLETE_PATH),
+        'vfat': ModProbeValue(value=True, source=MOD_OPTION_INFO_PATH),
     }
 
     assert 'install' in all_data
Repository: RedHatInsights/insights-core

Issue:
Spec ansible_tower_settings should have been created as multi_output
Since this spec is using a glob type of spec it can collect multiple files.  It needs to be defined as `multi_output=True` to work correctly.  This spec was added in merged PR #3102.


Discussion:

Resolving patch:
diff --git a/insights/specs/__init__.py b/insights/specs/__init__.py
--- a/insights/specs/__init__.py
+++ b/insights/specs/__init__.py
@@ -19,7 +19,7 @@ class Specs(SpecSet):
     abrt_ccpp_conf = RegistryPoint(filterable=True)
     abrt_status_bare = RegistryPoint()
     alternatives_display_python = RegistryPoint()
-    ansible_tower_settings = RegistryPoint(filterable=True)
+    ansible_tower_settings = RegistryPoint(filterable=True, multi_output=True)
     amq_broker = RegistryPoint(multi_output=True)
     ansible_host = RegistryPoint()
     auditctl_status = RegistryPoint()


Test patch: