From ac62ea0066934877f94e99bda6ec53a9c03ababb Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 20 Oct 2017 16:17:41 -0400 Subject: Fix lint --- .../byo/openshift-management/add_many_container_providers.yml | 10 ---------- .../filter_plugins/oo_management_filters.py | 9 +++++++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/playbooks/byo/openshift-management/add_many_container_providers.yml b/playbooks/byo/openshift-management/add_many_container_providers.yml index 3ab20b94c..62fdb11c5 100644 --- a/playbooks/byo/openshift-management/add_many_container_providers.yml +++ b/playbooks/byo/openshift-management/add_many_container_providers.yml @@ -26,16 +26,6 @@ with_items: "{{ container_providers }}" register: results - # TODO: Make this prettier and easier to read - - name: Save results - copy: - dest: /tmp/results.json - content: "{{ results.results | to_nice_json }}" - # state: present - # debug: - # var: item.item - # with_items: "{{ results.results }}" - # Include openshift_management for access to filter_plugins. - include_role: name: openshift_management diff --git a/roles/openshift_management/filter_plugins/oo_management_filters.py b/roles/openshift_management/filter_plugins/oo_management_filters.py index 06bc0796d..3b7013d9a 100644 --- a/roles/openshift_management/filter_plugins/oo_management_filters.py +++ b/roles/openshift_management/filter_plugins/oo_management_filters.py @@ -1,5 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +""" +Filter methods for the management role +""" + def oo_filter_container_providers(results): """results - the result from posting the API calls for adding new @@ -8,14 +12,15 @@ providers""" for result in results: if 'results' in result['json']: # We got an OK response - r = result['json']['results'][0] - all_results.append("Provider '{}' - Added successfully".format(r['name'])) + res = result['json']['results'][0] + all_results.append("Provider '{}' - Added successfully".format(res['name'])) elif 'error' in result['json']: # This was a problem all_results.append("Provider '{}' - Failed to add. Message: {}".format( result['item']['name'], result['json']['error']['message'])) return all_results + class FilterModule(object): """ Custom ansible filter mapping """ -- cgit v1.2.3