mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
lint cleanup
This commit is contained in:
parent
28c29459c8
commit
2aa971d2e5
2 changed files with 4 additions and 1 deletions
|
@ -300,9 +300,11 @@ def _decrypt_ciphertexts(cipher, translate_newlines=False):
|
|||
cipher = to_bytes(cipher)
|
||||
if translate_newlines:
|
||||
cipher = cipher.replace(to_bytes(r'\n'), to_bytes('\n'))
|
||||
|
||||
def replace(match):
|
||||
result = to_bytes(_decrypt_ciphertext(match.group()))
|
||||
return result
|
||||
|
||||
ret, num = GPG_CIPHERTEXT.subn(replace, to_bytes(cipher))
|
||||
if num > 0:
|
||||
# Remove trailing newlines. Without if crypted value initially specified as a YAML multiline
|
||||
|
@ -318,6 +320,7 @@ def _decrypt_ciphertexts(cipher, translate_newlines=False):
|
|||
pass
|
||||
return ret
|
||||
|
||||
|
||||
def _decrypt_object(obj, translate_newlines=False):
|
||||
'''
|
||||
Recursively try to decrypt any object. If the object is a six.string_types
|
||||
|
|
|
@ -167,4 +167,4 @@ class GPGTestCase(TestCase, LoaderModuleMockMixin):
|
|||
self.assertEqual(
|
||||
gpg.render(crypted, translate_newlines=True),
|
||||
expected,
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue