diff --git a/src/pylorax/api/projects.py b/src/pylorax/api/projects.py index 9b31eb09..6411e236 100644 --- a/src/pylorax/api/projects.py +++ b/src/pylorax/api/projects.py @@ -553,7 +553,7 @@ def get_source_ids(source_path): if not os.path.exists(source_path): return [] - cfg = ConfigParser() + cfg = ConfigParser(strict=False) cfg.read(source_path) return cfg.sections() @@ -587,7 +587,7 @@ def delete_repo_source(source_glob, source_name): found = False for f in glob(source_glob): try: - cfg = ConfigParser() + cfg = ConfigParser(strict=False) cfg.read(f) if source_name in cfg.sections(): found = True diff --git a/tests/pylorax/repos/duplicate-test.repo b/tests/pylorax/repos/duplicate-test.repo new file mode 100644 index 00000000..5f22f75f --- /dev/null +++ b/tests/pylorax/repos/duplicate-test.repo @@ -0,0 +1,23 @@ +[duplicate-repo] +name=Duplicate repo #1 +failovermethod=priority +baseurl=file:///tmp/lorax-empty-repo/ +enabled=1 +metadata_expire=7d +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False + +[duplicate-repo] +name=Duplicate repo #2 +failovermethod=priority +baseurl=file:///tmp/lorax-empty-repo/ +enabled=1 +metadata_expire=7d +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False