Blame SOURCES/0003-Enable-repos-when-generating-a-.repo-file-based-on-e.patch

3217a6
From 55e2f2d64372043e2fab96461243d808326bc902 Mon Sep 17 00:00:00 2001
3217a6
From: Daniel Mach <dmach@redhat.com>
3217a6
Date: Tue, 13 Nov 2018 12:17:58 +0100
3217a6
Subject: [PATCH 3/4] Enable repos when generating a .repo file based on
3217a6
 entitlement certificate.
3217a6
3217a6
Resolves: rhbz#1638850
3217a6
---
3217a6
 rhsm/rhsm-utils.c | 9 ++++++++-
3217a6
 1 file changed, 8 insertions(+), 1 deletion(-)
3217a6
3217a6
diff --git a/rhsm/rhsm-utils.c b/rhsm/rhsm-utils.c
3217a6
index b52a2b81f3c2ba2f881d7f1746d9e0c0b15ab189..6708a43a93f850f873a216d6f20aca8b7bd3225e 100644
3217a6
--- a/rhsm/rhsm-utils.c
3217a6
+++ b/rhsm/rhsm-utils.c
3217a6
@@ -245,13 +245,20 @@ rhsm_utils_yum_repo_from_context (RHSMContext *ctx)
3217a6
 
3217a6
           /* Now we have only available repos */
3217a6
           const gchar *id = json_object_get_string_member (repo, "label");
3217a6
           const gchar *name = json_object_get_string_member (repo, "name");
3217a6
           const gchar *path = json_object_get_string_member (repo, "path");
3217a6
-          gboolean enabled = FALSE;
3217a6
+
3217a6
+          /*
3217a6
+           * The "enabled" option defaults to "true".
3217a6
+           * If a content (repository) is enabled, the option is missing in the data,
3217a6
+           * most likely to save limited space in the certificate.
3217a6
+           */
3217a6
+          gboolean enabled = TRUE;
3217a6
           if (json_object_has_member (repo, "enabled"))
3217a6
             enabled = json_object_get_boolean_member (repo, "enabled");
3217a6
+
3217a6
           if (id == NULL || name == NULL || path == NULL)
3217a6
             continue; /* TODO: make some error reporting here */
3217a6
 
3217a6
           /* Clashing repositories */
3217a6
           if (g_key_file_has_group (repofile, id))
3217a6
-- 
3217a6
2.26.2
3217a6