mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
No need to specialcase comment characters
If the # is inside of quotes, it's a string. If it's outside of quotes then an exception will be raised which we'll catch and then send to the to_text() call at the end of the function anyhow. Fixes #22868
This commit is contained in:
@@ -327,7 +327,6 @@ class InventoryParser(object):
|
|||||||
Attempt to transform the string value from an ini file into a basic python object
|
Attempt to transform the string value from an ini file into a basic python object
|
||||||
(int, dict, list, unicode string, etc).
|
(int, dict, list, unicode string, etc).
|
||||||
'''
|
'''
|
||||||
if "#" not in v:
|
|
||||||
try:
|
try:
|
||||||
v = ast.literal_eval(v)
|
v = ast.literal_eval(v)
|
||||||
# Using explicit exceptions.
|
# Using explicit exceptions.
|
||||||
|
|||||||
Reference in New Issue
Block a user