mirror of
https://github.com/ansible/awx.git
synced 2026-01-23 07:28:02 -03:30
update logic
This commit is contained in:
parent
a0090c7c52
commit
6d88a81cbd
@ -413,7 +413,10 @@ class TowerAPIModule(TowerModule):
|
||||
def copy_item(self, existing_item, copy_from_name_or_id, new_item_name, endpoint=None, item_type='unknown', copy_lookup_data={}):
|
||||
|
||||
if existing_item is not None:
|
||||
self.fail_json(msg="A {0} with the name {1} already exists.".format(item_type, new_item_name))
|
||||
self.warn(msg="A {0} with the name {1} already exists.".format(item_type, new_item_name))
|
||||
self.json_output['changed'] = False
|
||||
self.json_output['copied'] = False
|
||||
return existing_item
|
||||
|
||||
# Lookup existing item to copy from
|
||||
copy_from_lookup = self.get_one(endpoint, name_or_id=copy_from_name_or_id, **{'data': copy_lookup_data})
|
||||
@ -441,6 +444,7 @@ class TowerAPIModule(TowerModule):
|
||||
if response['status_code'] in [201]:
|
||||
self.json_output['id'] = response['json']['id']
|
||||
self.json_output['changed'] = True
|
||||
self.json_output['copied'] = True
|
||||
new_existing_item = response['json']
|
||||
else:
|
||||
if 'json' in response and '__all__' in response['json']:
|
||||
|
||||
@ -212,7 +212,7 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result.copied
|
||||
|
||||
- name: Delete an SSH credential
|
||||
tower_credential:
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
- result.copied
|
||||
|
||||
- name: Delete an Inventory
|
||||
tower_inventory:
|
||||
|
||||
@ -142,7 +142,7 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result.copied
|
||||
|
||||
- name: Delete copied email notification
|
||||
tower_notification_template:
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
# the project, or it could be because the module actually failed somehow
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
- result.copied
|
||||
|
||||
- name: Check module fails with correct msg when given non-existing org as param
|
||||
tower_project:
|
||||
|
||||
@ -253,7 +253,7 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
- result.copied
|
||||
|
||||
- name: Fail Remove "on start" webhook notification from copied workflow job template
|
||||
tower_workflow_job_template:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user