Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7560

{inifile} : {problem with space in the value part}

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: inifile
    • Labels:
      None
    • QA Risk Assessment:
      Needs Assessment

      Description

      Basic Info
      Module Version: 2.3.0
      Puppet Version:  v5.3.6
      OS Name/Version: CentOS 7.5

      When the value contains space characters, then the line will change at every puppet run.

      Sample code:

       $default_yum_snapshot = { 'path' => '/etc/yum/pluginconf.d/fs-snapshot.conf', 'require' => 'Package[yum-plugin-fs-snapshot]' }
            $enable_yum_snaphot = { 'lvm' => { 'enabled' => '1' } }
            $lvm_size = { 'lvm' => { 'lvcreate_size_args' => '-l 25%ORIGIN' } }
            $disable_default = { 'main' => { 'enabled' => '0' } }
            $exclude = { 'main' => { 'exclude' => join(concat(['/var/log'], $yum_snapshot_exclude), ' ') } }
            create_ini_settings($enable_yum_snaphot, $default_yum_snapshot)
            create_ini_settings($lvm_size, $default_yum_snapshot)
            create_ini_settings($disable_default, $default_yum_snapshot)
            create_ini_settings($exclude, $default_yum_snapshot)
      

      Desired Behavior:

      Clean key /value setting

      [main]
      enabled = 0
      create_snapshots_in_post = 0
      exclude = /var/log[lvm]
      enabled = 1
      # 'lvcreate_size_args' option must specify the snapshot LV size using -L or -l
      #lvcreate_size_args = -l 15%ORIGIN
      lvcreate_size_args = -l 25%ORIGIN

      Actual Behavior:

      An line like this:

       [main]
      enabled = 0
      create_snapshots_in_post = 0
      exclude = /var/log[lvm]
      enabled = 1
      # 'lvcreate_size_args' option must specify the snapshot LV size using -L or -l
      #lvcreate_size_args = -l 15%ORIGIN
      lvcreate_size_args =       -l 25%ORIGIN

        Attachments

          Activity

            People

            • Assignee:
              loredana.ionce Loredana Ionce
              Reporter:
              puppetTux Frank
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support