Special character support for data set names will be added from the BetterArgParser by changing the _data_set_type and _data_set_or_path_type return value, currently those just returns the data set name as string, but new behavior is to add a dictionary as a return value.
That way, the modules will have to retrieve the new escaped named and the original user provided name inside the dictionary like:
Module utils uses of BetterArgParser
- Backup.py - use of "data_set" type
- Copy.py - use of "data_set" type
- Encode.py - use of "data_set" and "data_set_or_path" type.
Job.py. Uses it but won't be affected bc does not use a data set type validation.
try:
parser = better_arg_parser.BetterArgParser(arg_def)
parsed_args = parser.parse_args(module.params)
except ValueError as err:
module.fail_json(msg="Parameter verification failed", stderr=str(err))
# Use the escaped name as src.
src = parsed_args.get("src").get("parsed_name")
# Use the old-name for error messages.
_src = parsed_args.get("src").get("original_name")
Escaping special characters could be done via a new function inside the BetterArgParser.
These are some of the special characters:
Is there an existing issue for this?
Special character support for data set names will be added from the BetterArgParser by changing the
_data_set_type
and_data_set_or_path_type
return value, currently those just returns the data set name as string, but new behavior is to add a dictionary as a return value.That way, the modules will have to retrieve the new escaped named and the original user provided name inside the dictionary like:
Module utils uses of BetterArgParser
Job.py. Uses it but won't be affected bc does not use a data set type validation.
Escaping special characters could be done via a new function inside the BetterArgParser. These are some of the special characters:
Special character support
Ansible module
BetterArgParser