diff options
author | Joel Diaz <jdiaz@redhat.com> | 2017-02-28 20:40:14 +0000 |
---|---|---|
committer | Joel Diaz <jdiaz@redhat.com> | 2017-02-28 20:40:14 +0000 |
commit | db11dec91ae2125c7ec19090dd4ea5449ecec09e (patch) | |
tree | 88c2a3b044a002ce838d38b1bb5aa3aa42d32720 /roles/lib_openshift/library/oadm_manage_node.py | |
parent | 0d9ce34564d72520407cb1dba9a785e2faec49b9 (diff) | |
download | openshift-db11dec91ae2125c7ec19090dd4ea5449ecec09e.tar.gz openshift-db11dec91ae2125c7ec19090dd4ea5449ecec09e.tar.bz2 openshift-db11dec91ae2125c7ec19090dd4ea5449ecec09e.tar.xz openshift-db11dec91ae2125c7ec19090dd4ea5449ecec09e.zip |
regenerate lib_openshift with yedit exception changes
Diffstat (limited to 'roles/lib_openshift/library/oadm_manage_node.py')
-rw-r--r-- | roles/lib_openshift/library/oadm_manage_node.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/roles/lib_openshift/library/oadm_manage_node.py b/roles/lib_openshift/library/oadm_manage_node.py index 6a3543742..6287a45b0 100644 --- a/roles/lib_openshift/library/oadm_manage_node.py +++ b/roles/lib_openshift/library/oadm_manage_node.py @@ -267,7 +267,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] @@ -276,7 +277,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 @@ -290,6 +291,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[<int>] = "data" for a + # non-existent array + else: + raise YeditException("Error adding to object at path: {}".format(key)) + return data @staticmethod |