Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4744

Yumrepo doesn't recognize whitespace delimited reposdir settings in /etc/yum.conf

    Details

    • Template:
    • Story Points:
      1
    • Sprint:
      Client 2015-12-30, Client 2016-01-13
    • CS Priority:
      Reviewed
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      The reposdir setting for yum allows commas, whitespace including newlines, but puppet's yumrepo type only recognized commas and would add the repo definitions to /etc/yum.conf. This fix updates puppet to also recognize whitespace and newlines, creating repo definitions in /etc/yum.conf.d as expected.
      Show
      The reposdir setting for yum allows commas, whitespace including newlines, but puppet's yumrepo type only recognized commas and would add the repo definitions to /etc/yum.conf. This fix updates puppet to also recognize whitespace and newlines, creating repo definitions in /etc/yum.conf.d as expected.

      Description

      The inifile provider for the Yumrepo type searches various directories when deciding where to create repository definitions. One source of directories is the reposdir setting of /etc/yum.conf. Yum allows this setting to contain a list of directories delimited by either commas or whitespace, however Puppet only uses commas when parsing the setting.

      If the reposdir setting contains a whitespace delimited list of directories, then Puppet will almost silently (a DEBUG level message is logged) fall back to creating definitions directly in /etc/yum.conf.

      Reproduction Case

      • Install Puppet on a Red Hat system.
      • Add a reposdir setting to /etc/yum.conf which contains a whitespace-delimited list:

        echo 'reposdir=/etc/yum.conf.d /tmp' >> /etc/yum.conf
      

      • Attempt to create a new repo definition.

      Outcome

      The definition is added to /etc/yum.conf instead of a new file under /tmp/:

      # /opt/puppet/bin/puppet resource yumrepo foo ensure=present descr='foo repo'
      Notice: /Yumrepo[foo]/ensure: created
      yumrepo { 'foo':
        ensure => 'present',
        descr  => 'foo repo',
      }
       
      # ls /etc/yum.repos.d/foo.repo
      ls: cannot access /etc/yum.repos.d/foo.repo: No such file or directory
      

      Expected Outcome

      The definition is created under /tmp/ as it's the last reposdir specified

      # /opt/puppet/bin/puppet resource yumrepo foo ensure=present descr='foo repo'
      Notice: /Yumrepo[foo]/ensure: created
      yumrepo { 'foo':
        ensure => 'present',
        descr  => 'foo repo',
      }
       
      # ls /tmp/foo.repo 
      /tmp/foo.repo
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  steven.barlow Steve Barlow
                  Reporter:
                  chuck Charlie Sharpsteen
                  QA Contact:
                  Eric Thompson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: