Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop ui_repoid_vars from repo config. #2086

Merged
merged 1 commit into from Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/subscription_manager/repofile.py
Expand Up @@ -25,6 +25,7 @@
import os
import re
import string
import sys

try:
from debian.deb822 import Deb822
Expand All @@ -48,6 +49,9 @@

repo_files = []

# detect if running with yum, otherwise it's dnf
HAS_YUM = "yum" in sys.modules


class Repo(dict):
# (name, mutable, default) - The mutability information is only used in disconnected cases
Expand Down Expand Up @@ -124,7 +128,7 @@ def from_ent_cert_content(cls, content, baseurl, ca_cert, release_source):
# Extract the variables from the url
repo_parts = repo['baseurl'].split("/")
repoid_vars = [part[1:] for part in repo_parts if part.startswith("$")]
if repoid_vars:
if HAS_YUM and repoid_vars:
repo['ui_repoid_vars'] = " ".join(repoid_vars)

# If no GPG key URL is specified, turn gpgcheck off:
Expand Down
4 changes: 4 additions & 0 deletions test/test_repolib.py
Expand Up @@ -46,6 +46,10 @@
from subscription_manager.entcertlib import CONTENT_ACCESS_CERT_TYPE


# always pretend to run tests with yum in order to have 'ui_repoid_vars' available
repofile.HAS_YUM = True


class ConfigFromString(config.Config):
def __init__(self, config_string):
parser = RhsmConfigParserFromString(config_string)
Expand Down