Fix non-signature authentication (backport 2.8)
Apparently everyone is using signature authentication these days.
This commit is contained in:
parent
b66f77352d
commit
f65a1c4134
2 changed files with 7 additions and 5 deletions
2
changelogs/fragments/56038-fix-non-signature-auth.yaml
Normal file
2
changelogs/fragments/56038-fix-non-signature-auth.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- ACI modules - Fix non-signature authentication
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue