Fix pep8 error, remove redundant var assignment

This commit is contained in:
beeankha 2020-08-20 15:41:51 -04:00
parent 0fd618d88b
commit 54317236f3
2 changed files with 5 additions and 3 deletions

View File

@ -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]

View File

@ -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: