[PR #8917/89ad40db backport][stable-9] proxmox inventory: remove duplicated credentials line (#8919)

proxmox inventory: remove duplicated credentials line (#8917)

* proxmox inventory: remove duplicated credentials line

* fixup! proxmox inventory: remove duplicated credentials line

* fixup! proxmox inventory: remove duplicated credentials line

(cherry picked from commit 89ad40db41)

Co-authored-by: Per Fide <perfide@users.noreply.github.com>
pull/8924/head
patchback[bot] 2024-09-25 14:01:03 +03:00 committed by GitHub
parent ad1cf82a34
commit f3aca8a575
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1,2 @@
minor_changes:
- proxmox inventory plugin - clean up authentication code (https://github.com/ansible-collections/community.general/pull/8917).

View File

@ -275,11 +275,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
return self.session return self.session
def _get_auth(self): def _get_auth(self):
credentials = urlencode({'username': self.proxmox_user, 'password': self.proxmox_password, })
if self.proxmox_password: if self.proxmox_password:
credentials = urlencode({'username': self.proxmox_user, 'password': self.proxmox_password, }) credentials = urlencode({'username': self.proxmox_user, 'password': self.proxmox_password})
a = self._get_session() a = self._get_session()