From 352efc87ea712253d1fbb88d09f2d2832ae2b2b3 Mon Sep 17 00:00:00 2001 From: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:14:52 -0400 Subject: [PATCH] fix: Resolve error in `handle_updates` when key is not valid (#496) * Check that property_metadata is not None before referencing * oops * oops * Replace key in with .get(key) is not None --- plugins/module_utils/linode_helper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/linode_helper.py b/plugins/module_utils/linode_helper.py index da9fb984..9030478e 100644 --- a/plugins/module_utils/linode_helper.py +++ b/plugins/module_utils/linode_helper.py @@ -136,7 +136,11 @@ def handle_updates( # We should convert properties to sets # if they are annotated as unordered in the # Python SDK. - if property_metadata.get(key).unordered: + if ( + property_metadata is not None + and property_metadata.get(key) is not None + and property_metadata.get(key).unordered + ): has_diff = set(old_value) != set(new_value) if has_diff: