Add encoding option to API modules (#95)

* Set encoding to UTF-8.

* Add encoding parameter to API modules.

* librouteros is now patched.
This commit is contained in:
Felix Fontein 2022-05-24 22:19:26 +02:00 committed by GitHub
parent 7452195071
commit 023f11f7e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 33 deletions

View file

@ -277,7 +277,7 @@ def main():
for modification in modifications:
try:
api_path.update(**modification)
except LibRouterosError as e:
except (LibRouterosError, UnicodeEncodeError) as e:
module.fail_json(
msg='Error while modifying for .id={id}: {error}'.format(
id=modification['.id'],