From bf780c709d2dca567204844b928f5fbbfa70873d Mon Sep 17 00:00:00 2001 From: yaacov Date: Mon, 25 Sep 2017 14:56:23 +0300 Subject: [PATCH] move manageiq_entities to module utils --- lib/ansible/module_utils/manageiq.py | 10 ++++++++++ .../remote_management/manageiq/manageiq_tags.py | 12 +----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/ansible/module_utils/manageiq.py b/lib/ansible/module_utils/manageiq.py index a7091ccec34..329d26d4467 100755 --- a/lib/ansible/module_utils/manageiq.py +++ b/lib/ansible/module_utils/manageiq.py @@ -67,6 +67,16 @@ def validate_connection_params(module): module.fail_json(msg=error_str.format(arg)) +def manageiq_entities(): + return { + 'provider': 'providers', 'host': 'hosts', 'vm': 'vms', + 'category': 'categories', 'cluster': 'clusters', 'data store': 'data_stores', + 'group': 'groups', 'resource pool': 'resource_pools', 'service': 'services', + 'service template': 'service_templates', 'template': 'templates', + 'tenant': 'tenants', 'user': 'users', 'blueprint': 'blueprints' + } + + class ManageIQ(object): """ class encapsulating ManageIQ API client. diff --git a/lib/ansible/modules/remote_management/manageiq/manageiq_tags.py b/lib/ansible/modules/remote_management/manageiq/manageiq_tags.py index 0395c8886b5..9a0bf5366eb 100644 --- a/lib/ansible/modules/remote_management/manageiq/manageiq_tags.py +++ b/lib/ansible/modules/remote_management/manageiq/manageiq_tags.py @@ -91,17 +91,7 @@ RETURN = ''' ''' from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.manageiq import ManageIQ, manageiq_argument_spec - - -def manageiq_entities(): - return { - 'provider': 'providers', 'host': 'hosts', 'vm': 'vms', - 'category': 'categories', 'cluster': 'clusters', 'data store': 'data_stores', - 'group': 'groups', 'resource pool': 'resource_pools', 'service': 'services', - 'service template': 'service_templates', 'template': 'templates', - 'tenant': 'tenants', 'user': 'users', 'blueprint': 'blueprints' - } +from ansible.module_utils.manageiq import ManageIQ, manageiq_argument_spec, manageiq_entities def query_resource_id(manageiq, resource_type, resource_name):