mirror of
https://github.com/ansible/awx.git
synced 2026-02-13 07:34:51 -03:30
Run flake8 on the AWX collection in CI
This commit is contained in:
@@ -89,8 +89,6 @@ EXAMPLES = '''
|
||||
- http://tower.com/api/v2/
|
||||
'''
|
||||
|
||||
import time
|
||||
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
|
||||
|
||||
@@ -129,9 +127,6 @@ def main():
|
||||
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this
|
||||
module.delete_if_needed(application)
|
||||
|
||||
# Attempt to look up associated field items the user specified.
|
||||
association_fields = {}
|
||||
|
||||
# Create the data that gets sent for create and update
|
||||
application_fields = {
|
||||
'name': name,
|
||||
|
||||
@@ -68,7 +68,6 @@ EXAMPLES = '''
|
||||
|
||||
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -96,7 +96,6 @@ EXAMPLES = '''
|
||||
credential: 'all'
|
||||
'''
|
||||
|
||||
from os import environ
|
||||
import logging
|
||||
from ansible.module_utils.six.moves import StringIO
|
||||
from ..module_utils.awxkit import ControllerAWXKitModule
|
||||
|
||||
@@ -56,7 +56,7 @@ import logging
|
||||
|
||||
# In this module we don't use EXPORTABLE_RESOURCES, we just want to validate that our installed awxkit has import/export
|
||||
try:
|
||||
from awxkit.api.pages.api import EXPORTABLE_RESOURCES
|
||||
from awxkit.api.pages.api import EXPORTABLE_RESOURCES # noqa
|
||||
|
||||
HAS_EXPORTABLE_RESOURCES = True
|
||||
except ImportError:
|
||||
|
||||
@@ -151,7 +151,7 @@ def main():
|
||||
module.fail_json(msg='Unable to wait on ' + job_type.rstrip("s") + ' {0}; that ID does not exist.'.format(job_id))
|
||||
|
||||
# Invoke wait function
|
||||
result = module.wait_on_url(url=job['url'], object_name=job_id, object_type='legacy_job_wait', timeout=timeout, interval=interval)
|
||||
module.wait_on_url(url=job['url'], object_name=job_id, object_type='legacy_job_wait', timeout=timeout, interval=interval)
|
||||
|
||||
module.exit_json(**module.json_output)
|
||||
|
||||
|
||||
@@ -232,9 +232,6 @@ def wait_for_project_update(module, last_request):
|
||||
if not wait:
|
||||
module.exit_json(**module.json_output)
|
||||
|
||||
# Grab our start time to compare against for the timeout
|
||||
start = time.time()
|
||||
|
||||
# Invoke wait function
|
||||
result_final = module.wait_on_url(
|
||||
url=result['json']['url'], object_name=module.get_item_name(last_request), object_type='Project Update', timeout=timeout, interval=interval
|
||||
@@ -293,12 +290,10 @@ def main():
|
||||
scm_update_on_launch = module.params.get('scm_update_on_launch')
|
||||
scm_update_cache_timeout = module.params.get('scm_update_cache_timeout')
|
||||
default_ee = module.params.get('default_environment')
|
||||
custom_virtualenv = module.params.get('custom_virtualenv')
|
||||
organization = module.params.get('organization')
|
||||
state = module.params.get('state')
|
||||
wait = module.params.get('wait')
|
||||
update_project = module.params.get('update_project')
|
||||
interval = module.params.get('interval')
|
||||
|
||||
# Attempt to look up the related items the user specified (these will fail the module if not found)
|
||||
lookup_data = {}
|
||||
|
||||
@@ -78,8 +78,6 @@ EXAMPLES = '''
|
||||
'''
|
||||
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import json
|
||||
import time
|
||||
|
||||
|
||||
def main():
|
||||
@@ -126,9 +124,6 @@ def main():
|
||||
if not wait:
|
||||
module.exit_json(**module.json_output)
|
||||
|
||||
# Grab our start time to compare against for the timeout
|
||||
start = time.time()
|
||||
|
||||
# Invoke wait function
|
||||
result = module.wait_on_url(
|
||||
url=result['json']['url'], object_name=module.get_item_name(project), object_type='Project Update', timeout=timeout, interval=interval
|
||||
|
||||
@@ -555,8 +555,6 @@ def create_schema_nodes(module, response, schema, workflow_id):
|
||||
|
||||
# Start Approval Node creation process
|
||||
if workflow_node['unified_job_template']['type'] == 'workflow_approval':
|
||||
new_fields = {}
|
||||
|
||||
for field_name in (
|
||||
'name',
|
||||
'description',
|
||||
@@ -627,7 +625,6 @@ def create_schema_nodes_association(module, response, schema, workflow_id):
|
||||
if sub_obj is None:
|
||||
module.fail_json(msg='Could not find {0} entry with name {1}'.format(association, sub_name))
|
||||
id_list.append(sub_obj['id'])
|
||||
temp = sub_obj['id']
|
||||
if id_list:
|
||||
association_fields[association] = id_list
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ RETURN = """
|
||||
|
||||
|
||||
from ..module_utils.controller_api import ControllerAPIModule
|
||||
import time
|
||||
|
||||
|
||||
def main():
|
||||
@@ -91,10 +90,7 @@ def main():
|
||||
timeout = module.params.get("timeout")
|
||||
interval = module.params.get("interval")
|
||||
|
||||
node_url = "workflow_jobs/{0}/workflow_nodes/?job__name={1}".format(workflow_job_id, name)
|
||||
# Attempt to look up workflow job node based on the provided id
|
||||
|
||||
result = module.wait_on_workflow_node_url(
|
||||
module.wait_on_workflow_node_url(
|
||||
url="workflow_jobs/{0}/workflow_nodes/".format(workflow_job_id),
|
||||
object_name=name,
|
||||
object_type="Workflow Node",
|
||||
|
||||
Reference in New Issue
Block a user