Make non-required params actually optional, fix idempotency issues

This commit is contained in:
beeankha
2020-02-25 23:51:26 -05:00
parent 1c4042340c
commit b532012748
8 changed files with 24 additions and 16 deletions

View File

@@ -123,11 +123,12 @@ def main():
# Create the data that gets sent for create and update
host_fields = {
'name': new_name if new_name else name,
'description': description,
'inventory': inventory_id,
'enabled': enabled,
}
if variables:
if description is not None:
host_fields['description'] = description
if variables is not None:
host_fields['variables'] = json.dumps(variables)
if state == 'absent':