-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept trailing commas in list
config type
#80908
Comments
Files identified in the description: If these files are incorrect, please update the |
this has an issue with the ability to add empty items to a list, specially if it is the last one |
You can have empty quotes ( |
empty path == relative path == cwd (current working directory) |
I'm sure you know that Either way, no file API or OS I'm aware of considers the empty string to be a legal path, whether absolute or relative. |
Python specifically is one of those things where an empty path effectively means cwd.
As such pretty much all of our code, including, but not limited to, We handle any cases where an empty string doesn't meet expectations on a case by case basis, and not on a global basis. |
I should also note, that in our Also, for values supplied in |
So one of my goals in this and the other issue is to clearly document what the format is, even if it doesn't change. Right now, you have things like this. It says |
Summary
It's not documented exactly what delimits a list. In the code, it's commas:
ansible/lib/ansible/config/manager.py
Line 94 in 3a1d58b
But trailing commas are not supported, because they introduce spurious empty string elements. It would be nice, since the INI-style config file format accepts multiline values de facto.
And of course, document all the above.
Issue Type
Feature Idea
Component Name
lib/ansible/config/manager.py
Additional Information
I'm preparing a PR for this. But first, please see #80907.
Code of Conduct
The text was updated successfully, but these errors were encountered: