-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[PR #1611/ad953e83 backport][stable-6] Backup plan params bugfix This is a backport of PR #1611 as merged into main (ad953e8). SUMMARY This updates the backup_plan module to remove all None values from nested dicts in supplied params. Previously nested None values were retained and caused errors when sent through to the boto3 client calls. ISSUE TYPE Bugfix Pull Request COMPONENT NAME backup_plan ADDITIONAL INFORMATION Creating or updating a plan without providing an optional value in a nested dict would result in that value being set to None, and it wasn't being removed. For example: - name: Update Backup plan amazon.aws.backup_plan: backup_plan_name: my-backup-plan rules: - rule_name: my-rule target_backup_vault_name: my-vault schedule_expression: "cron(0 * ? * * *)" lifecycle: move_to_cold_storage_after_days: 30 The optional lifecycle.delete_after_days option in the above example would be set to None by default, and the removal of None values wasn't recursively going through the entire dict. This is now fixed and the above example will work. Reviewed-by: Alina Buzachis
- Loading branch information
1 parent
f7d461e
commit de4eefe
Showing
3 changed files
with
135 additions
and
5 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
changelogs/fragments/202306012-backup_plan-remove-none-from-nested-params.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- backup_plan - Use existing `scrub_none_values` function from module_utils to remove None values from nested dicts in supplied params. Nested None values were being retained and causing an error when sent through to the boto3 client operation (https://github.com/ansible-collections/amazon.aws/pull/1611). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters