From 2b0e335752cb02d9166e89e3f869ec8d13dc2ddb Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 4 Dec 2022 12:57:24 +0100 Subject: [PATCH] [PR #5602/632fc07e backport][stable-6] Updated tags delimiter (#5652) Updated tags delimiter (#5602) * Updated tags delimiter Starting from Proxmox 7.3 tags are delimited by semicolon. For backward compatibility it needs to be splitted by both commas and semicolons. * Added missing space * Add changelog fragment. Co-authored-by: Felix Fontein (cherry picked from commit 632fc07e65778cf236a8da35bf4204bddcd052b0) Co-authored-by: domelek <40233039+domelek@users.noreply.github.com> --- changelogs/fragments/5602-proxmox-tags.yml | 2 ++ plugins/inventory/proxmox.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/5602-proxmox-tags.yml diff --git a/changelogs/fragments/5602-proxmox-tags.yml b/changelogs/fragments/5602-proxmox-tags.yml new file mode 100644 index 0000000000..32498f0366 --- /dev/null +++ b/changelogs/fragments/5602-proxmox-tags.yml @@ -0,0 +1,2 @@ +bugfixes: + - "proxmox inventory plugin - handle tags delimited by semicolon instead of comma, which happens from Proxmox 7.3 on (https://github.com/ansible-collections/community.general/pull/5602)." diff --git a/plugins/inventory/proxmox.py b/plugins/inventory/proxmox.py index 904579a494..e33f7ed77d 100644 --- a/plugins/inventory/proxmox.py +++ b/plugins/inventory/proxmox.py @@ -408,7 +408,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): stripped_value = value.strip() if stripped_value: parsed_key = key + "_parsed" - properties[parsed_key] = [tag.strip() for tag in stripped_value.split(",")] + properties[parsed_key] = [tag.strip() for tag in stripped_value.replace(',', ';').split(";")] # The first field in the agent string tells you whether the agent is enabled # the rest of the comma separated string is extra config for the agent.