summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
authorTomas Sedovic <tomas@sedovic.cz>2018-01-02 16:11:29 +0100
committerTomas Sedovic <tomas@sedovic.cz>2018-01-02 16:11:29 +0100
commitff1d04276bbc8a7542ff0e33a12e1b971e2745b7 (patch)
treebdfa6f5bb8a6b3681a6a953f1a11f45790140d2b /playbooks
parent5a99c7b6acf1c4bc0f1a83af77bf434ac5b45548 (diff)
downloadopenshift-ff1d04276bbc8a7542ff0e33a12e1b971e2745b7.tar.gz
openshift-ff1d04276bbc8a7542ff0e33a12e1b971e2745b7.tar.bz2
openshift-ff1d04276bbc8a7542ff0e33a12e1b971e2745b7.tar.xz
openshift-ff1d04276bbc8a7542ff0e33a12e1b971e2745b7.zip
Return a openshift_node_labels as a dict
The OpenStack dynamic inventory was setting the `openshift_node_labels` value as a string which causes a failure with the `lib_utils_oo_dict_to_keqv_list` filter. Fixes #6555
Diffstat (limited to 'playbooks')
-rwxr-xr-xplaybooks/openstack/sample-inventory/inventory.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/playbooks/openstack/sample-inventory/inventory.py b/playbooks/openstack/sample-inventory/inventory.py
index ad3fd936b..55d2f7211 100755
--- a/playbooks/openstack/sample-inventory/inventory.py
+++ b/playbooks/openstack/sample-inventory/inventory.py
@@ -9,6 +9,7 @@ environment.
from __future__ import print_function
+from collections import Mapping
import json
import shade
@@ -94,6 +95,10 @@ def build_inventory():
hostvars['openshift_public_hostname'] = server.name
node_labels = server.metadata.get('node_labels')
+ # NOTE(shadower): the node_labels value must be a dict not string
+ if not isinstance(node_labels, Mapping):
+ node_labels = json.loads(node_labels)
+
if node_labels:
hostvars['openshift_node_labels'] = node_labels