salt icon indicating copy to clipboard operation
salt copied to clipboard

ini_manage with white space delimiter?

Open junster1 opened this issue 11 years ago • 4 comments

Based one what I can see you can't use space delimited key value pairs, it only assumes either an = or :. Is this something that could be added?

option_regexp1 = re.compile(r'\s*(.+?)\s*(=)(.*)') option_regexp2 = re.compile(r'\s*(.+?)\s*(:)(.*)')

I also noticed that if you have a comment like this: ## my comment

It will be silently updated to # # my comment

Here is the version info for this issue.

Salt: 2014.7.2
Python: 2.7.5 (default, Feb 11 2014, 07:46:25)
Jinja2: 2.7.2
M2Crypto: 0.21.1
msgpack-python: 0.1.13
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.10
ioflo: Not Installed
PyZMQ: 14.3.1
RAET: Not Installed
ZMQ: 4.0.4
Mako: Not Installed

junster1 avatar Mar 31 '15 21:03 junster1

@junster1, I did not know that (some?) ini-formatted files supported whitespace-separated key, value pairs. Thanks for the feature. That comment thing looks annoying too.

jfindlay avatar Apr 01 '15 19:04 jfindlay

The system sees everything after a '#' or ';' as a comment. While writing the file back, It is introducing a space between # and the actual comment. Can be fixed.

The ini file with whitespace is too tricky. It is not defined in the Ini syntax either.

Akilesh1597 avatar Aug 16 '15 13:08 Akilesh1597

Please check pull request 26359

Akilesh1597 avatar Aug 16 '15 14:08 Akilesh1597

@Akilesh1597, thanks for working on this.

jfindlay avatar Sep 08 '15 20:09 jfindlay