Fix non-signature authentication (backport 2.8)

Apparently everyone is using signature authentication these days.
This commit is contained in:
Dag Wieers 2019-05-03 01:42:16 +02:00 committed by Toshio Kuratomi
parent b66f77352d
commit f65a1c4134
2 changed files with 7 additions and 5 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ACI modules - Fix non-signature authentication

View file

@ -335,7 +335,7 @@ class ACIModule(object):
self.url = '%(protocol)s://%(host)s/' % self.params + path.lstrip('/')
# Sign and encode request as to APIC's wishes
if not self.params['private_key']:
if self.params['private_key']:
self.cert_auth(path=path, payload=payload)
# Perform request
@ -372,7 +372,7 @@ class ACIModule(object):
self.url = '%(protocol)s://%(host)s/' % self.params + path.lstrip('/')
# Sign and encode request as to APIC's wishes
if not self.params['private_key']:
if self.params['private_key']:
self.cert_auth(path=path, method='GET')
# Perform request
@ -659,7 +659,7 @@ class ACIModule(object):
elif not self.module.check_mode:
# Sign and encode request as to APIC's wishes
if not self.params['private_key']:
if self.params['private_key']:
self.cert_auth(method='DELETE')
resp, info = fetch_url(self.module, self.url,
@ -795,7 +795,7 @@ class ACIModule(object):
uri = self.url + self.filter_string
# Sign and encode request as to APIC's wishes
if not self.params['private_key']:
if self.params['private_key']:
self.cert_auth(path=self.path + self.filter_string, method='GET')
resp, info = fetch_url(self.module, uri,
@ -896,7 +896,7 @@ class ACIModule(object):
return
elif not self.module.check_mode:
# Sign and encode request as to APIC's wishes
if not self.params['private_key']:
if self.params['private_key']:
self.cert_auth(method='POST', payload=json.dumps(self.config))
resp, info = fetch_url(self.module, self.url,