From ff1d04276bbc8a7542ff0e33a12e1b971e2745b7 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Tue, 2 Jan 2018 16:11:29 +0100 Subject: 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 --- playbooks/openstack/sample-inventory/inventory.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'playbooks/openstack') 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 -- cgit v1.2.3