summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-03-03 15:40:42 -0500
committerGitHub <noreply@github.com>2017-03-03 15:40:42 -0500
commit15601e4b3bbd4aebc4dfd3e6736854af35820150 (patch)
tree32f9eff43fc023668f393b890c8faebc61332c41 /roles
parente2bc346fc99de637d03762b4b813b596afffc7dc (diff)
parent7dbca133a2600b0c49482ca10aaf3f0d8e46f1a0 (diff)
downloadopenshift-15601e4b3bbd4aebc4dfd3e6736854af35820150.tar.gz
openshift-15601e4b3bbd4aebc4dfd3e6736854af35820150.tar.bz2
openshift-15601e4b3bbd4aebc4dfd3e6736854af35820150.tar.xz
openshift-15601e4b3bbd4aebc4dfd3e6736854af35820150.zip
Merge pull request #3499 from sdodson/1422348
Don't install python-ruamel-yaml
Diffstat (limited to 'roles')
-rw-r--r--roles/lib_openshift/library/oc_adm_policy_group.py11
-rw-r--r--roles/lib_openshift/library/oc_adm_policy_user.py11
-rw-r--r--roles/lib_openshift/meta/main.yml3
-rw-r--r--roles/lib_openshift/tasks/main.yml10
-rw-r--r--roles/lib_utils/meta/main.yml3
-rw-r--r--roles/lib_utils/tasks/main.yml10
6 files changed, 20 insertions, 28 deletions
diff --git a/roles/lib_openshift/library/oc_adm_policy_group.py b/roles/lib_openshift/library/oc_adm_policy_group.py
index 3bc5dea0e..0ab1c8d49 100644
--- a/roles/lib_openshift/library/oc_adm_policy_group.py
+++ b/roles/lib_openshift/library/oc_adm_policy_group.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[<int>] = "data" for a
+ # non-existent array
+ else:
+ raise YeditException("Error adding to object at path: {}".format(key))
+
return data
@staticmethod
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[<int>] = "data" for a
+ # non-existent array
+ else:
+ raise YeditException("Error adding to object at path: {}".format(key))
+
return data
@staticmethod
diff --git a/roles/lib_openshift/meta/main.yml b/roles/lib_openshift/meta/main.yml
index 7c72daa63..d5e7ec6e5 100644
--- a/roles/lib_openshift/meta/main.yml
+++ b/roles/lib_openshift/meta/main.yml
@@ -11,5 +11,4 @@ galaxy_info:
- 7
categories:
- cloud
-dependencies:
-- { role: openshift_repos }
+dependencies: []
diff --git a/roles/lib_openshift/tasks/main.yml b/roles/lib_openshift/tasks/main.yml
index b8af7c7c9..ed97d539c 100644
--- a/roles/lib_openshift/tasks/main.yml
+++ b/roles/lib_openshift/tasks/main.yml
@@ -1,11 +1 @@
---
-- name: lib_openshift detect ostree
- stat:
- path: /run/ostree-booted
- register: ostree_booted
-
-- name: lib_openshift ensure python-ruamel-yaml package is on target
- package:
- name: python2-ruamel-yaml
- state: present
- when: not ostree_booted.stat.exists
diff --git a/roles/lib_utils/meta/main.yml b/roles/lib_utils/meta/main.yml
index e06b9a0f1..cc18c453c 100644
--- a/roles/lib_utils/meta/main.yml
+++ b/roles/lib_utils/meta/main.yml
@@ -11,5 +11,4 @@ galaxy_info:
- 7
categories:
- cloud
-dependencies:
-- { role: openshift_repos }
+dependencies: []
diff --git a/roles/lib_utils/tasks/main.yml b/roles/lib_utils/tasks/main.yml
index 32ab9e0c6..ed97d539c 100644
--- a/roles/lib_utils/tasks/main.yml
+++ b/roles/lib_utils/tasks/main.yml
@@ -1,11 +1 @@
---
-- name: lib_utils detect ostree
- stat:
- path: /run/ostree-booted
- register: ostree_booted
-
-- name: lib_utils ensure python-ruamel-yaml package is on target
- package:
- name: python-ruamel-yaml
- state: present
- when: not ostree_booted.stat.exists