puppetlabs-inifile icon indicating copy to clipboard operation
puppetlabs-inifile copied to clipboard

Can't set the same key twice

Open iawells opened this issue 12 years ago • 15 comments

If I want the same key twice in an ini file (which is not, I think, a general property of ini files, but one that Openstack nevertheless uses for certain types), I can't. Can I suggest we use something of the form: value => ['a', 'b', 'c'] ?

(reported via Dan a few weeks ago, but it's not a bug here, so I'm being tidy)

iawells avatar May 06 '13 16:05 iawells

I have misgivings about this one. I'm thrilled that this module has come in handy for openstack, but it's intended to be a really general-purpose module, and I feel a little weird about the idea of adding a feature that explicitly breaks the most-generally-agreed-upon definition of what is and isn't legal in an INI file. I also think that the implementation of this is likely to be fairly ugly. I thought that I'd convinced @bodepd that this didn't seem like a great idea :)

cprice404 avatar May 06 '13 16:05 cprice404

He neglected to inform me of that.

The nice thing about it as suggested is its backward compatible but I sympathise with making the code icky.

iawells avatar May 06 '13 16:05 iawells

Yeah, and to be clear I'm not saying "there is no way we should consider this"... just that my initial instinct is against it.

cprice404 avatar May 06 '13 16:05 cprice404

Hi, I'm currently trying to implement this feature as OpenStack's Ceilometer requires such a config value. I'll propose the eventual implementation here as soon as I have something working and not breaking the current features.

fcharlier avatar May 13 '13 16:05 fcharlier

@fcharlier did you ever get a patch working for this?

bodepd avatar Aug 28 '13 18:08 bodepd

@bodepd unfortunately I didn't manage to get something to work properly and not break compatibility.

fcharlier avatar Sep 05 '13 08:09 fcharlier

@fcharlier how does the thing that breaks compatibility look like?

igalic avatar Oct 11 '13 02:10 igalic

@igalic I had at the time managed to get/set keys with multiple values where values were arrays, but I didn't manage to have keys having values using strings & keys having multipe values using arrays.

I also had some problems removing values from multiple-valued keys ...

fcharlier avatar Oct 11 '13 08:10 fcharlier

Hello! We are doing some house keeping and noticed that this issue has been open for a long time.

We're going to close it but please do raise another issue if the issue still persists. 😄

chelnak avatar Mar 08 '22 15:03 chelnak

This still persists and would be nice to have. Please reopen, @chelnak.

For example, git's style of ini files allows multiple entries with the same key, so you can't use this module to manage them, have to use exec workarounds.

Same bug report: https://tickets.puppetlabs.com/browse/MODULES-5012

kenyon avatar Mar 09 '22 04:03 kenyon

Hello! 👋

This issue has been open for a while and has had no recent activity. We've labelled it with attention-needed so that we can get a clear view of which issues need our attention.

If you are waiting on a response from us we will try and address your comments on a future Community Day.

Alternatively, if it is no longer relevant to you please close the issue with a comment.

github-actions[bot] avatar Sep 12 '22 02:09 github-actions[bot]

reopen

kenyon avatar Sep 20 '22 03:09 kenyon

Note: https://github.com/puppetlabs/puppetlabs-inifile/pull/481 seems to be a potential fix for this issue. However, lack of engagement might result in the ticket being closed. Posting link here for future reference, just in case.

LukasAud avatar Oct 17 '22 12:10 LukasAud

would be great to have that feature

vmpr avatar Jul 07 '23 03:07 vmpr

I have the same problem. :( In my case I must set something like:

[foo]
bar = 1
bar = 2

Sample application, that need this: https://docs.posit.co/connect/admin/python/#enabling-python-support

tuxmaster5000 avatar Nov 16 '23 12:11 tuxmaster5000