uac_cli.utils package
Submodules
uac_cli.utils.config module
uac_cli.utils.options module
uac_cli.utils.process module
- uac_cli.utils.process.add_payload_value(vars_dict, _input, binary)[source]
Modify vars_dict with payload data extracted from _input.
If _input is non-binary, it is read as a dictionary. Values in vars_dict (from command line arguments) are converted and used to overwrite corresponding keys in the payload dictionary.
If _input is binary, the raw data is stored directly under the “data” key in vars_dict.
- Parameters:
vars_dict (dict) – Dictionary of existing key-value pairs.
_input (file-like or None) – Optional input stream with data to be added.
binary (bool) – Flag indicating if _input is binary data.
Note: Command Line keys will only overwrite existing keys in the payload; new keys will NOT be added.
- uac_cli.utils.process.process_input(args, _input=None, binary=False)[source]
Processes input arguments (including argument file) into a dictionary of key-value pairs.
Converts a list of “key=value” strings into a dictionary.If an argument file exists, reads additional key-value pairs from it, adding keys not present.
If _input is provided and the keys “retain_sys_ids” or “retainSysIds” are absent, adds “retain_sys_ids” = “true”. Then calls add_payload_value to overwrite duplicate keys.
- Parameters:
args (list of str) – Command line arguments as “key=value” strings.
_input (optional) – Input stream supplying JSON or binary payload.
binary (bool) – Whether _input is binary data.
- Returns:
Dictionary of all parsed and merged key-value pairs.
- Return type:
dict