From 1830191258b9148b6ce286fa63d30c41e048a146 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Thu, 9 Jul 2015 20:26:33 -0400 Subject: example create_host --- filter_plugins/oo_filters.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'filter_plugins') diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index 0f3f4fa9e..4e4a7309d 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -223,6 +223,15 @@ class FilterModule(object): # Gather up the values for the list of keys passed in return [x for x in data if x[filter_attr]] + @staticmethod + def oo_build_zabbix_list_dict(values, string): + ''' Build a list of dicts with string as key for each value + ''' + rval = [] + for value in values: + rval.append({string: value}) + return rval + def filters(self): ''' returns a mapping of filters to methods ''' return { @@ -235,5 +244,6 @@ class FilterModule(object): "oo_ec2_volume_definition": self.oo_ec2_volume_definition, "oo_combine_key_value": self.oo_combine_key_value, "oo_split": self.oo_split, - "oo_filter_list": self.oo_filter_list + "oo_filter_list": self.oo_filter_list, + "oo_build_zabbix_list_dict": self.oo_build_zabbix_list_dict } -- cgit v1.2.1