mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Fix pep8 error, remove redundant var assignment
This commit is contained in:
parent
0fd618d88b
commit
54317236f3
@ -114,12 +114,15 @@ class TowerAPIModule(TowerModule):
|
||||
try:
|
||||
query_params['or__id'] = int(name_or_id)
|
||||
except ValueError:
|
||||
# If we got a value error than we didn't have an integer so we can just pass and fall down to the fail
|
||||
# If we get a value error, then we didn't have an integer so we can just pass and fall down to the fail
|
||||
pass
|
||||
|
||||
response = self.get_endpoint(endpoint, **{'data': query_params})
|
||||
if response['status_code'] != 200:
|
||||
self.fail_json(msg="Failed to query endpoint {0} for {1} {2} ({3}), see results".format(endpoint, name_field, name_or_id, response['status_code']), resuls=response)
|
||||
self.fail_json(
|
||||
msg="Failed to query endpoint {0} for {1} {2} ({3}), see results".format(endpoint, name_field, name_or_id, response['status_code']),
|
||||
resuls=response
|
||||
)
|
||||
|
||||
if response['json']['count'] == 1:
|
||||
return response['json']['results'][0]
|
||||
|
||||
@ -126,7 +126,6 @@ def main():
|
||||
resource_data = {}
|
||||
for param in resource_param_keys:
|
||||
endpoint = module.param_to_endpoint(param)
|
||||
name_field = 'username' if param == 'user' else 'name'
|
||||
|
||||
resource_name = params.get(param)
|
||||
if resource_name:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user