Browse Source

Merge pull request #8313 from mbarnes/repoquery-exclude

repoquery: Omit exclude lines when ignoring excluders
Vadim Rutkovsky 6 years ago
parent
commit
3c340e2af1
2 changed files with 2 additions and 2 deletions
  1. 1 1
      roles/lib_utils/library/repoquery.py
  2. 1 1
      roles/lib_utils/src/class/repoquery.py

+ 1 - 1
roles/lib_utils/library/repoquery.py

@@ -536,7 +536,7 @@ class Repoquery(RepoqueryCLI):
             with open("/etc/yum.conf", "r") as file_handler:
                 yum_conf_lines = file_handler.readlines()
 
-            yum_conf_lines = ["exclude=" if l.startswith("exclude=") else l for l in yum_conf_lines]
+            yum_conf_lines = [l for l in yum_conf_lines if not l.startswith("exclude=")]
 
             with open(self.tmp_file.name, "w") as file_handler:
                 file_handler.writelines(yum_conf_lines)

+ 1 - 1
roles/lib_utils/src/class/repoquery.py

@@ -117,7 +117,7 @@ class Repoquery(RepoqueryCLI):
             with open("/etc/yum.conf", "r") as file_handler:
                 yum_conf_lines = file_handler.readlines()
 
-            yum_conf_lines = ["exclude=" if l.startswith("exclude=") else l for l in yum_conf_lines]
+            yum_conf_lines = [l for l in yum_conf_lines if not l.startswith("exclude=")]
 
             with open(self.tmp_file.name, "w") as file_handler:
                 file_handler.writelines(yum_conf_lines)