diff options
author | Dag Wieers <dag@wieers.com> | 2019-04-17 00:35:36 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2019-04-16 15:35:36 -0700 |
commit | 653e9da22826afeef69d81f2033b643c24d69cf4 (patch) | |
tree | e6c3329c2fcd11cc2231d46b876995cda722a1b5 | |
parent | ca49ae7ba5af69b515af9417a2c156decc424166 (diff) | |
download | ansible-653e9da22826afeef69d81f2033b643c24d69cf4.tar.gz |
ACI: Ensure we use native strings for signature (#55161)
* ACI: Ensure we use native strings for signature
* Add changelog fragment
-rw-r--r-- | changelogs/fragments/55150-native-strings-for-signature-auth.yaml | 2 | ||||
-rw-r--r-- | lib/ansible/module_utils/network/aci/aci.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/changelogs/fragments/55150-native-strings-for-signature-auth.yaml b/changelogs/fragments/55150-native-strings-for-signature-auth.yaml new file mode 100644 index 0000000000..f43c2b7699 --- /dev/null +++ b/changelogs/fragments/55150-native-strings-for-signature-auth.yaml @@ -0,0 +1,2 @@ +bugfixes: +- aci modules - Ensure we use native strings for signature diff --git a/lib/ansible/module_utils/network/aci/aci.py b/lib/ansible/module_utils/network/aci/aci.py index 4e8d9df3ad..0e44fc45cf 100644 --- a/lib/ansible/module_utils/network/aci/aci.py +++ b/lib/ansible/module_utils/network/aci/aci.py @@ -38,7 +38,7 @@ from copy import deepcopy from ansible.module_utils.parsing.convert_bool import boolean from ansible.module_utils.urls import fetch_url -from ansible.module_utils._text import to_bytes +from ansible.module_utils._text import to_bytes, to_native # Optional, only used for APIC signature-based authentication try: @@ -241,7 +241,7 @@ class ACIModule(object): self.headers['Cookie'] = 'APIC-Certificate-Algorithm=v1.0; ' +\ 'APIC-Certificate-DN=%s; ' % sig_dn +\ 'APIC-Certificate-Fingerprint=fingerprint; ' +\ - 'APIC-Request-Signature=%s' % sig_signature + 'APIC-Request-Signature=%s' % to_native(sig_signature) def response_json(self, rawoutput): ''' Handle APIC JSON response output ''' |