Bug 1746245

Summary: [AWS] RHEL8 choose_repo.py should re-enable enabled repositories after renaming the repo file
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Alexey Masolov <amasolov>
Component: OperationsAssignee: Todd Sanders <tsanders>
Status: CLOSED CURRENTRELEASE QA Contact: Vratislav Hutsky <vhutsky>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: mminar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-06 10:08:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexey Masolov 2019-08-28 05:05:30 UTC
Description of problem:
rh-amazon-rhui-client updates is not preserving selected repos. 


How reproducible:
100%

Steps to Reproduce:
===
# curl http://169.254.169.254/latest/meta-data/ami-id
ami-0975ce566eec139c3

# rpm -qa rh-amazon*
rh-amazon-rhui-client-3.0.17-1.el8.noarch

# dnf config-manager --set-enabled rhui-codeready-builder-for-rhel-8-rhui-rpms
# yum repolist
repo id                                                                                                repo name                                                                                                                      status
rhui-client-config-server-8                                                                            Red Hat Update Infrastructure 3 Client Configuration Server 8                                                                      3
rhui-codeready-builder-for-rhel-8-rhui-rpms                                                            Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs) from RHUI                                                             1,497
rhui-rhel-8-appstream-rhui-rpms                                                                        Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)                                                             5,760
rhui-rhel-8-baseos-rhui-rpms                                                                           Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)                                                                2,097

# dnf -y update rh-amazon-rhui-client
…
Upgraded:
  rh-amazon-rhui-client-3.0.19-1.el8.noarch

Complete!

# dnf repolist
repo id                                                                                        repo name                                                                                                                              status
rhel-8-appstream-rhui-rpms                                                                     Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)                                                                     5,760
rhel-8-baseos-rhui-rpms                                                                        Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)                                                                        2,097
rhui-client-config-server-8                                                                    Red Hat Update Infrastructure 3 Client Configuration Server 8                                                                              3
===

Actual results:
choose_repo.py renames the repo file in /etc/yum.repos.d and replaces it with the new one with default repositories/streams enabled

Expected results:
Preserving enabled repositories after updating

Additional info: