From 0df41241dd8741cb5978437ef42478172811b48e Mon Sep 17 00:00:00 2001
From: hklausing <hklausing@users.noreply.github.com>
Date: Sun, 31 Oct 2021 20:21:38 +0100
Subject: [PATCH] Fixed - TypeError: unexpected keyword argument (#3649)

* Fixed - TypeError: unexpected keyword argument

- File proxmox_group_info.py creates the error "TypeError:
  get_group() got an unexpected keyword argument \'group\'\r\n'" if a
  group parameter is used.
  Issue is an argument naming conflict. After changing the argument
  name to 'groupid', as used in method ProxmoxGroupInfoAnsible::get_group,
  testing a Proxmox group name is working now.

* Changelog fragment added for #3649

changelog fragment for TypeError: unexpected keyword argument #3649

* Update changelogs/fragments/3649-proxmox_group_info_TypeError.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
---
 changelogs/fragments/3649-proxmox_group_info_TypeError.yml | 3 +++
 plugins/modules/cloud/misc/proxmox_group_info.py           | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 changelogs/fragments/3649-proxmox_group_info_TypeError.yml

diff --git a/changelogs/fragments/3649-proxmox_group_info_TypeError.yml b/changelogs/fragments/3649-proxmox_group_info_TypeError.yml
new file mode 100644
index 0000000000..9620ea7203
--- /dev/null
+++ b/changelogs/fragments/3649-proxmox_group_info_TypeError.yml
@@ -0,0 +1,3 @@
+---
+bugfixes:
+  - proxmox_group_info - fix module crash if a ``group`` parameter is used (https://github.com/ansible-collections/community.general/pull/3649).
diff --git a/plugins/modules/cloud/misc/proxmox_group_info.py b/plugins/modules/cloud/misc/proxmox_group_info.py
index 3d60e7e214..734ecb0f8a 100644
--- a/plugins/modules/cloud/misc/proxmox_group_info.py
+++ b/plugins/modules/cloud/misc/proxmox_group_info.py
@@ -131,7 +131,7 @@ def main():
     group = module.params['group']
 
     if group:
-        groups = [proxmox.get_group(group=group)]
+        groups = [proxmox.get_group(groupid=group)]
     else:
         groups = proxmox.get_groups()
     result['proxmox_groups'] = [group.group for group in groups]