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

Implement `print` method for `server_list_settings`

    XMLWordPrintable

Details

    • Enhancement
    • Hide
      Previously, if you wanted to view your `server_list` in `config print`, Puppet would output it in a human-unfriendly nested Array that was hard to read. Now it will output the text in the same format it's entered in puppet.conf. It will also output it this way when Puppet errors from being unable to connect to any server in `server_list`.
      Show
      Previously, if you wanted to view your `server_list` in `config print`, Puppet would output it in a human-unfriendly nested Array that was hard to read. Now it will output the text in the same format it's entered in puppet.conf. It will also output it this way when Puppet errors from being unable to connect to any server in `server_list`.
    • Needs Assessment

    Description

      Right now, when you run `puppet config print server_list`, you get a gross looking array. This should print what you see in `puppet.conf`, a comma separated list of servers. Not the strange ruby array we get now

      [1] Melissa@bubba:/Users/Melissa/puppet:(5.5.x)$ be ./bin/puppet config set server_list server_list_1,server_list_2
      [0] Melissa@bubba:/Users/Melissa/puppet:(5.5.x)$ be ./bin/puppet config print server_list
      [["server_list_1"], ["server_list_2"]]
      [0] Melissa@bubba:/Users/Melissa/puppet:(5.5.x)$ cat ~/.puppetlabs/etc/puppet/puppet.conf
      [main]
      server = server1
      server_list = server_list_1,server_list_2
      

      It looks like this is a more general problem for settings that derive from `:array`.

      All of this is from josh's comment:
      https://github.com/puppetlabs/puppet/pull/7384#issuecomment-462976534

      to quote him,

      I'd expect the `ArraySetting` to implement `print` to join using comma:

      def print(value)
        vals = super(value)
        vals.join(',')
      end
      

      And for `ServerListSetting` to override it so that each host and optional port are first joined with ':', and then that result is comma-joined:

      def print(value)
        vals = munge(value)
        super(vals.map { |v| v.join(':') })
      end
      

      Attachments

        Activity

          People

            jorie Jorie Tappa
            melissa Melissa Stone
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support