ini inventory now requires extension#83983
Conversation
|
I think on balance this is probably a good idea, but it might need a deprecation cycle where it warns about non-matching filenames instead of ignoring them. Failing to parse an inventory source defaults to not being a fatal error so this could sneakily break things. There's also the issue of And of course there's the question of |
|
ignore ext was my next stop, i was also considering a 'strict_ext' option (would be temporary) to do what you say and warn/advise about extensions or adding |
|
@nitzmahone w/o extension is fine, the problem is 'all extensions', which keeps making ini plugin take toml/yaml/others lower in the precedence of the enable list. I did have a 'no extension' version with deprecation, but then realized it didn't conflict with anything else. |
It does actually: |
|
rarely, first, script has higher precedence by default and most scripts do have extensions. Another reason i don't exclude executable here is because 'samba' mounts normally make everything executable and are a favorite of .ini users. And scripts tend not to be 'ini compatible' like yaml or toml can be. |
|
That's of course not so much an issue with "real world" inventories- the most recent case I ran into was a new test for |
|
yes, why i was adding the restriction from any to 'ini' and w/o, yaml has higher precedence and has always had an extension list. The current settings should handle every case I've seen a ticket for. |
0de1b99 to
a954a43
Compare
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
774c930 to
84bae7c
Compare
|
|
||
| def verify_file(self, path): | ||
| # hardcode exclusion for TOML to prevent partial parsing of things we know we don't want | ||
| return super().verify_file(path) and os.path.splitext(path)[1] != '.toml' |
There was a problem hiding this comment.
There are two previous behaviors:
- 2.18 and earlier - parse all files
- 2.19 and 2.20 - parse all files except
.toml
The change in 2.19 was a bug fix (which was overlooked in the changelog). To keep that fix, the empty list should keep the second behavior instead of switching back to the first. In the unlikely event someone actually wants to parse .toml files with this plugin, they can specify that in their configuration by listing the extensions they want.
The empty list fallback behavior should also be deprecated, so we don't need to keep it around long-term.
|
since it was an undocumented and backwards incompatible change and toml has since been decided to not be a first class citizen, i didn't make the toml exclusive change and I don't really think it is needed. i was deprecating the fallback in previous iterations, i took it out because you said it was confusing ... now it should be back? |
What was backward incompatible? |
|
people using toml extensions, we had a couple of reports about that |
|
I think I'd ignore people doing weird things, an deny toml extensions in the ini plugin. |
|
this denies all extensions, not just toml, since it, by default, only allows ini and 'no extension', i just dont see the use of adding a 'all extensions exctept toml' option. |
|
We only need to support two configurations:
The first configuration gives us the behavior we want, including allowing users to parse |
but has option to enable previous behaviour
related #83981
ISSUE TYPE