Module "Yum Add Repo" should not replace "-" with "_" in repo_id
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hello.
there is no need to replace character "-" with "_" in repo id add using "Yum Add Repo" cloud-init module. All RHEL, EPEL or other vendor's repo ids contain "-" as word separator (eg. rhel-7-server-rpms, rhel-7-
In this case I used OpenStack, RHEL 8.5 with cloud-init-
Cloud-init user-data.yaml looks like this:
yum_repos:
rhel-
baseurl: <url>
name: "repo name"
enabled: True
...
On deployed Nova instance result is:
ls /etc/yum.repos.d/
rhel_8.
head rhel_8.
# created by cloud-init on ...
[rhel_8.
baseurl = ...
...
Expected result was:
/etc/yum.
with content
[rhel-8.
baseurl = ...
I looked into code and found this function, where I recommend to remove this line:
git diff
diff --git a/cloudinit/
index f7357192..8face5bf 100644
--- a/cloudinit/
+++ b/cloudinit/
@@ -118,7 +118,6 @@ __doc__ = get_meta_doc(meta)
def _canonicalize_
- repo_id = repo_id.
repo_id = repo_id.replace(" ", "_")
return repo_id
Sorry, there is mismatch in bug description, but the point is clear, I hope. Just replace 8.6 with 8.5.