mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 08:57:35 -02:30
update to use isdigit and updated tests
This commit is contained in:
@@ -103,11 +103,11 @@ def main():
|
||||
timeout = module.params.get('timeout')
|
||||
|
||||
# Attempt to look up project based on the provided name or id
|
||||
if name.isnumeric():
|
||||
if name.isdigit():
|
||||
results = module.get_endpoint('projects', **{'data': {'id': name}})
|
||||
if results['json']['count'] == 0:
|
||||
module.fail_json(msg='Could not find Project with ID: {0}'.format(name))
|
||||
project = results['json']['results'][0]
|
||||
if project is None:
|
||||
module.fail_json(msg="Unable to find project")
|
||||
else:
|
||||
lookup_data = {'name': name}
|
||||
if organization:
|
||||
|
||||
Reference in New Issue
Block a user