Skip to content

Commit 0ec47e6

Browse files
authored
Workaround for empty global settings idempotency (#25)
1 parent ba2aa7a commit 0ec47e6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- cs_configuration - Workaround for empty global settings idempotency (https://github.com/ngine-io/ansible-collection-cloudstack/pull/25).

plugins/modules/cs_configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ def present_configuration(self):
224224
configuration = self.get_configuration()
225225
args = self._get_common_configuration_args()
226226
args['value'] = self.get_value()
227-
if self.has_changed(args, configuration, ['value']):
227+
empty_value = args['value'] in [None, ''] and 'value' not in configuration
228+
if self.has_changed(args, configuration, ['value']) and not empty_value:
228229
self.result['changed'] = True
229230
if not self.module.check_mode:
230231
res = self.query_api('updateConfiguration', **args)

0 commit comments

Comments
 (0)