← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1975818] Re: Module "Yum Add Repo" should not replace "-" with "_" in repo_id

 

This bug is believed to be fixed in cloud-init in version 22.3. If this
is still a problem for you, please make a comment and set the state back
to New

Thank you.

** Changed in: cloud-init
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1975818

Title:
  Module "Yum Add Repo" should not replace "-" with "_" in repo_id

Status in cloud-init:
  Fix Released

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-server-extras-rpms, rhel-7-server-optional-rpms,
  rhel-7-server-supplementary-rpm, epel-modular, docker-ce-stable, ...).
  This behavior breaks consistency with standard RHEL repo id naming.

  
  In this case I used OpenStack, RHEL 8.5 with cloud-init-21.1-7.el8._5.3.

  Cloud-init user-data.yaml looks like this:

  yum_repos:
    rhel-8.5-appstream-mycloud:
      baseurl: <url>
      name: "repo name"
      enabled: True
      ...

  On deployed Nova instance result is:

  ls /etc/yum.repos.d/
  rhel_8.6_appstream_mycloud.repo

  head rhel_8.6_appstream_mycloud.repo
  # created by cloud-init on ...
  [rhel_8.6_appstream_mycloud]
  baseurl = ...
  ...

  
  Expected result was:

  /etc/yum.repos.d/rhel-8.5-appstream-mycloud.repo

  with content

  [rhel-8.5-appstream-mycloud]
  baseurl = ...


  I looked into code and found this function, where I recommend to
  remove this line:

  git diff
  diff --git a/cloudinit/config/cc_yum_add_repo.py b/cloudinit/config/cc_yum_add_repo.py
  index f7357192..8face5bf 100644
  --- a/cloudinit/config/cc_yum_add_repo.py
  +++ b/cloudinit/config/cc_yum_add_repo.py
  @@ -118,7 +118,6 @@ __doc__ = get_meta_doc(meta)

  
   def _canonicalize_id(repo_id):
  -    repo_id = repo_id.lower().replace("-", "_")
       repo_id = repo_id.replace(" ", "_")
       return repo_id

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1975818/+subscriptions



References