From 00b03095554a175cba0a4a47da6ee4cc5f39f7de Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 3 Mar 2017 15:28:46 -0500 Subject: Re-generate modules --- roles/lib_openshift/library/oc_adm_policy_user.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'roles/lib_openshift/library/oc_adm_policy_user.py') diff --git a/roles/lib_openshift/library/oc_adm_policy_user.py b/roles/lib_openshift/library/oc_adm_policy_user.py index 1ac9bf54d..91bd85122 100644 --- a/roles/lib_openshift/library/oc_adm_policy_user.py +++ b/roles/lib_openshift/library/oc_adm_policy_user.py @@ -253,7 +253,8 @@ class Yedit(object): continue elif data and not isinstance(data, dict): - return None + raise YeditException("Unexpected item type found while going through key " + + "path: {} (at key: {})".format(key, dict_key)) data[dict_key] = {} data = data[dict_key] @@ -262,7 +263,7 @@ class Yedit(object): int(arr_ind) <= len(data) - 1): data = data[int(arr_ind)] else: - return None + raise YeditException("Unexpected item type found while going through key path: {}".format(key)) if key == '': data = item @@ -276,6 +277,12 @@ class Yedit(object): elif key_indexes[-1][1] and isinstance(data, dict): data[key_indexes[-1][1]] = item + # didn't add/update to an existing list, nor add/update key to a dict + # so we must have been provided some syntax like a.b.c[] = "data" for a + # non-existent array + else: + raise YeditException("Error adding to object at path: {}".format(key)) + return data @staticmethod -- cgit v1.2.1