From 7ee6a2805d6bbee38a9510c5bb2bef48f21a09aa Mon Sep 17 00:00:00 2001 From: Eliezer P <73103+eliezerlp@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:03:29 -0400 Subject: [PATCH] Allow unracking devices by setting position = 0 --- plugins/module_utils/netbox_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/module_utils/netbox_utils.py b/plugins/module_utils/netbox_utils.py index 71d13bc9c..4940bd347 100644 --- a/plugins/module_utils/netbox_utils.py +++ b/plugins/module_utils/netbox_utils.py @@ -1297,6 +1297,9 @@ def _normalize_data(self, data): if k == "mac_address": data[k] = v.upper() + if k == "position" and v == 0: + data[k] = None + # We need to assign the correct type for the assigned object so the user doesn't have to worry about this. # We determine it by whether or not they pass in a device or virtual_machine if data.get("assigned_object"):