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

inifile : Multiple remove will only remove the value, not the setting self.

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: inifile
    • Labels:
      None
    • QA Risk Assessment:
      Needs Assessment

      Description

      Basic Info
      Module Version: 2.4.0
      Puppet Version: 4.10.12
      OS Name/Version: CentOS 7.5

      Create/change values with create_ini_settings will work, but not to remove lines.

      Desired Behavior: That the settings are removed

      Actual Behavior: Only the value, but not the setting self is removed.

      sample code:

      $defaults_remove = { 'ensure' => 'absent', 'path' => $etcd_config_file, notify => Service[$etcd_service], require => Package[$etcd_package] }
      $old_client = { '' => { 'ETCD_LISTEN_CLIENT_URLS' => '' } }
      $old_advice_clients = { '' => { 'ETCD_ADVERTISE_CLIENT_URLS' => '' } }
      create_ini_settings($old_client, $defaults_remove)
      create_ini_settings($old_advice_clients, $defaults_remove)  

      Before:

      Foo=Foo
      ETCD_ADVERTISE_CLIENT_URLS= sample
      ETCD_LISTEN_CLIENT_URLS = sample
      Bar=bar

      Result in the ini file:

      Foo=Foo
      ETCD_ADVERTISE_CLIENT_URLS=
      ETCD_LISTEN_CLIENT_URLS =
      Bar=bar

      Desired content:

      Foo=Foo
      Bar=bar

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              puppetTux Frank
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Zendesk Support