related #11229 consider previous set json_output changed in

controller_api

job_template module sets self.json_output['changed'] to true before calling create_or_update_if_needed.

Signed-off-by: Nico Ohnezat <nico@no-12.net>
This commit is contained in:
Nico Ohnezat 2021-10-08 23:30:07 +02:00
parent d1800aa6d0
commit 815ef4c9c9

View File

@ -909,7 +909,7 @@ class ControllerAPIModule(ControllerModule):
if response['status_code'] == 200:
# compare apples-to-apples, old API data to new API data
# but do so considering the fields given in parameters
self.json_output['changed'] = self.objects_could_be_different(existing_item, response['json'], field_set=new_item.keys(), warning=True)
self.json_output['changed'] |= self.objects_could_be_different(existing_item, response['json'], field_set=new_item.keys(), warning=True)
elif 'json' in response and '__all__' in response['json']:
self.fail_json(msg=response['json']['__all__'])
else: