From 06cd13f98ab0a4b18861c5af8aae4d76e12c633e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Tue, 20 Sep 2016 14:34:16 +0200 Subject: Update the OpenStack dynamic inventory script --- filter_plugins/oo_filters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'filter_plugins') diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index eeb04cb4e..7b4eb59c8 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -546,7 +546,7 @@ class FilterModule(object): return certificates @staticmethod - def oo_pretty_print_cluster(data): + def oo_pretty_print_cluster(data, prefix='tag_'): """ Read a subset of hostvars and build a summary of the cluster in the following layout: @@ -573,8 +573,8 @@ class FilterModule(object): returns 'value2' """ for tag in tags: - if tag[:len(key)+4] == 'tag_' + key: - return tag[len(key)+5:] + if tag[:len(prefix)+len(key)] == prefix + key: + return tag[len(prefix)+len(key)+1:] raise KeyError(key) def _add_host(clusters, -- cgit v1.2.1