mirror of
https://github.com/ansible/awx.git
synced 2026-04-11 21:19:22 -02:30
update to tower module
This commit is contained in:
@@ -77,7 +77,7 @@ EXAMPLES = '''
|
|||||||
wait: False
|
wait: False
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from ..module_utils.tower_api import TowerModule
|
from ..module_utils.tower_api import TowerAPIModule
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ def main():
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Create a module for ourselves
|
# Create a module for ourselves
|
||||||
module = TowerModule(argument_spec=argument_spec)
|
module = TowerAPIModule(argument_spec=argument_spec)
|
||||||
|
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
@@ -111,7 +111,7 @@ def main():
|
|||||||
else:
|
else:
|
||||||
lookup_data = {'name': name}
|
lookup_data = {'name': name}
|
||||||
if organization:
|
if organization:
|
||||||
lookup_data['organization'] = module.get_one_by_name_or_id('organizations', organization)
|
lookup_data['organization'] = module.resolve_name_to_id('organizations', organization)
|
||||||
project = module.get_one('projects', data=lookup_data)
|
project = module.get_one('projects', data=lookup_data)
|
||||||
if project is None:
|
if project is None:
|
||||||
module.fail_json(msg="Unable to find project")
|
module.fail_json(msg="Unable to find project")
|
||||||
|
|||||||
Reference in New Issue
Block a user