diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2017-03-03 09:56:40 -0500 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2017-03-06 09:09:14 -0500 |
commit | 4efb4cb5c1f96e843786ca021a704c018f9a8012 (patch) | |
tree | 02339aebe92f649748ea9ab304ca55886a3e8ffb /roles/lib_openshift/library | |
parent | a4fe8bfa6b4122bc1215bcb9798caf1c5eb6d181 (diff) | |
download | openshift-4efb4cb5c1f96e843786ca021a704c018f9a8012.tar.gz openshift-4efb4cb5c1f96e843786ca021a704c018f9a8012.tar.bz2 openshift-4efb4cb5c1f96e843786ca021a704c018f9a8012.tar.xz openshift-4efb4cb5c1f96e843786ca021a704c018f9a8012.zip |
Regenerated code with latest yedit changes.
Diffstat (limited to 'roles/lib_openshift/library')
-rw-r--r-- | roles/lib_openshift/library/oc_project.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/roles/lib_openshift/library/oc_project.py b/roles/lib_openshift/library/oc_project.py index c4d7f1917..823b8318a 100644 --- a/roles/lib_openshift/library/oc_project.py +++ b/roles/lib_openshift/library/oc_project.py @@ -260,7 +260,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] @@ -269,7 +270,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 @@ -283,6 +284,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 @@ -1276,8 +1283,8 @@ class Utils(object): elif value != user_def[key]: if debug: print('value should be identical') - print(value) print(user_def[key]) + print(value) return False # recurse on a dictionary @@ -1297,8 +1304,8 @@ class Utils(object): if api_values != user_values: if debug: print("keys are not equal in dict") - print(api_values) print(user_values) + print(api_values) return False result = Utils.check_def_equal(user_def[key], value, skip_keys=skip_keys, debug=debug) |