mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-13 12:39:10 -07:00
fix decrypted vault utf8 values (#37539)
* Fix errors decrypted non-ascii vault vars AnsibleVaultEncryptedUnicode was just using b"".decode() instead of to_text() on the bytestrings returned from vault.decrypt() and could cause errors on python2 if non-ascii since decode() defaults to ascii. Use to_text() to default to decoding utf-8. add intg and unit tests for value of vaulted vars being non-ascii utf8 based on https://github.com/ansible/ansible/issues/37258 Fixes #37258 * yamllint fixups
This commit is contained in:
parent
bbe57cbf90
commit
1613a739ad
6 changed files with 40 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
# This file is part of Ansible
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -149,3 +150,8 @@ class TestAnsibleVaultEncryptedUnicode(unittest.TestCase, YamlTestUtils):
|
|||
return avu == seq
|
||||
|
||||
self.assertRaises(AnsibleError, compare, avu, seq)
|
||||
|
||||
def test_vaulted_utf8_value_37258(self):
|
||||
seq = u"aöffü"
|
||||
avu = self._from_plaintext(seq)
|
||||
self.assert_values(avu, seq)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue