Skip to content

[AI Generated] BugFix: fix CentOS 7/8 yum repo init by scoping vault rewrite and disabling OpenLogic repo#4439

Open
LiliDeng wants to merge 1 commit intomainfrom
fix/centos-openlogic-repo
Open

[AI Generated] BugFix: fix CentOS 7/8 yum repo init by scoping vault rewrite and disabling OpenLogic repo#4439
LiliDeng wants to merge 1 commit intomainfrom
fix/centos-openlogic-repo

Conversation

@LiliDeng
Copy link
Copy Markdown
Collaborator

Summary

Fix CentOS 7/8 marketplace image yum repo initialization. Restrict the olcentgbl.trafficmanager.netvault.centos.org rewrite to /centos/ and /$contentdir/ paths only (where the vault actually mirrors), disable any OpenLogic*.repo (whose /openlogic/... baseurl has no vault.centos.org equivalent), and apply skip_if_unavailable=true per failed repo so the per-repo False in stock CentOS repo files cannot override it.

Validation Results

Image Result
OpenLogic CentOS 7_7-gen2 7.7.20200213 PASSED
OpenLogic CentOS 7_9 7.9.2022101800 PASSED
OpenLogic CentOS 8_3 8.3.2020120900 PASSED

Copilot AI review requested due to automatic review settings April 27, 2026 12:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates CentOS 7/8 yum repository initialization in CentOs._initialize_package_installation to better handle EOL mirror changes and broken OpenLogic-hosted repos, aiming to make package operations succeed on Azure marketplace CentOS images.

Changes:

  • Scope olcentgbl.trafficmanager.netvault.centos.org rewrites to only /centos/ and /$contentdir/ paths.
  • Disable OpenLogic*.repo by renaming matching repo files so yum won’t try unreachable /openlogic/... baseurls.
  • Apply skip_if_unavailable=true globally and per failed repo extracted from yum repolist -v output.

Comment thread lisa/operating_system.py Outdated
Comment thread lisa/operating_system.py Outdated
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: redhat rhel 9_5 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 44.289

@LiliDeng LiliDeng force-pushed the fix/centos-openlogic-repo branch from 694dd43 to 04a70ef Compare April 27, 2026 12:53
…rewrite and disabling OpenLogic repo

CentOS 7/8 marketplace images on Azure ship with two issues that
break package installation now that mirror.centos.org is gone:

1. Some images carry an OpenLogic.repo whose baseurl points at
   olcentgbl.trafficmanager.net/openlogic/... — a path that has no
   vault.centos.org equivalent. A blanket host rewrite from
   olcentgbl.trafficmanager.net to vault.centos.org turns the DNS
   error into a 404 but still breaks yum.

2. The stock CentOS repo files set skip_if_unavailable=False per
   repo, which overrides any global value set on [main]. So even
   with skip_if_unavailable=true on [main], a single failing repo
   still blocks the whole `yum install`.

Fix:

* Restrict the olcentgbl -> vault.centos.org rewrite to the
  `/centos/` (CentOS 7) and `/$contentdir/` (CentOS 8) path
  components, where vault.centos.org actually mirrors the tree.
  Other paths are left alone.
* Disable any OpenLogic*.repo by renaming it to
  OpenLogic*.repo.disabled (case-insensitive glob; filename casing
  varies across images).
* Use plain (BRE) sed with literal strings; extended regex with
  alternation and "\$contentdir" inside a single-quoted "sh -c"
  argument has been observed to silently no-op on some images.
* Parse `yum repolist -v` output for "failure: <repodata> from
  <repoid>:" and apply skip_if_unavailable=true to each failing
  repo individually so per-repo settings cannot override us.

Validated on Azure marketplace images:

* OpenLogic CentOS 7_7-gen2 7.7.20200213 — yum install kexec-tools
  succeeded ("installed successfully")
* OpenLogic CentOS 7_9 7.9.2022101800 — VM provisioning + repo
  init clean
* OpenLogic CentOS 8_3 8.3.2020120900 — VM provisioning + repo
  init clean
Copilot AI review requested due to automatic review settings April 27, 2026 12:57
@LiliDeng LiliDeng force-pushed the fix/centos-openlogic-repo branch from 04a70ef to 1c41ae9 Compare April 27, 2026 12:57
@github-actions
Copy link
Copy Markdown

⚠️ AI Test Selection — cancelled

1 test case(s) selected (view run)

Marketplace image: redhat rhel 9_5 latest

Count
✅ Passed 0
❌ Failed 0
⏭️ Skipped 0
Total 0
Test case details
Test Case Status Time (s) Message

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: redhat rhel 9_5 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 67.327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants