mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Fix module-specific lint errors
This commit is contained in:
@@ -161,7 +161,7 @@ class InventoryModule(BaseInventoryPlugin):
|
|||||||
inventory_url = '/api/v2/inventories/{inv_id}/script/?hostvars=1&towervars=1&all=1'.format(inv_id=inventory_id)
|
inventory_url = '/api/v2/inventories/{inv_id}/script/?hostvars=1&towervars=1&all=1'.format(inv_id=inventory_id)
|
||||||
inventory_url = urljoin(tower_host, inventory_url)
|
inventory_url = urljoin(tower_host, inventory_url)
|
||||||
|
|
||||||
inventory = self.make_request(request_handler, inventory_url)
|
inventory = make_request(request_handler, inventory_url)
|
||||||
# To start with, create all the groups.
|
# To start with, create all the groups.
|
||||||
for group_name in inventory:
|
for group_name in inventory:
|
||||||
if group_name != '_meta':
|
if group_name != '_meta':
|
||||||
@@ -191,7 +191,7 @@ class InventoryModule(BaseInventoryPlugin):
|
|||||||
# Fetch extra variables if told to do so
|
# Fetch extra variables if told to do so
|
||||||
if self.get_option('include_metadata'):
|
if self.get_option('include_metadata'):
|
||||||
config_url = urljoin(tower_host, '/api/v2/config/')
|
config_url = urljoin(tower_host, '/api/v2/config/')
|
||||||
config_data = self.make_request(request_handler, config_url)
|
config_data = make_request(request_handler, config_url)
|
||||||
server_data = {}
|
server_data = {}
|
||||||
server_data['license_type'] = config_data.get('license_info', {}).get('license_type', 'unknown')
|
server_data['license_type'] = config_data.get('license_info', {}).get('license_type', 'unknown')
|
||||||
for key in ('version', 'ansible_version'):
|
for key in ('version', 'ansible_version'):
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import json
|
|||||||
import os
|
import os
|
||||||
import traceback
|
import traceback
|
||||||
from ansible.module_utils._text import to_native
|
from ansible.module_utils._text import to_native
|
||||||
from ansible.module_utils.urls import Request, urllib_error, ConnectionError, socket, httplib
|
from ansible.module_utils.urls import urllib_error, ConnectionError, socket, httplib
|
||||||
from ansible.errors import AnsibleParserError
|
from ansible.errors import AnsibleParserError
|
||||||
|
|
||||||
TOWER_CLI_IMP_ERR = None
|
TOWER_CLI_IMP_ERR = None
|
||||||
@@ -50,7 +50,7 @@ except ImportError:
|
|||||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||||
|
|
||||||
|
|
||||||
def make_request(self, request_handler, tower_url):
|
def make_request(module, request_handler, tower_url):
|
||||||
'''
|
'''
|
||||||
Makes the request to given URL, handles errors, returns JSON
|
Makes the request to given URL, handles errors, returns JSON
|
||||||
'''
|
'''
|
||||||
|
|||||||
Reference in New Issue
Block a user