Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup plan params bugfix #1611

Conversation

hakbailey
Copy link
Contributor

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.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/16741e684e584f42ad1b77f122873031

✔️ ansible-galaxy-importer SUCCESS in 4m 08s
✔️ build-ansible-collection SUCCESS in 13m 40s
✔️ ansible-test-splitter SUCCESS in 5m 08s
✔️ integration-amazon.aws-1 SUCCESS in 6m 49s
Skipped 43 jobs

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/819de275016045c3a3b672624a00d93b

✔️ ansible-galaxy-importer SUCCESS in 4m 12s
✔️ build-ansible-collection SUCCESS in 13m 32s
✔️ ansible-test-splitter SUCCESS in 4m 47s
✔️ integration-amazon.aws-1 SUCCESS in 5m 53s
Skipped 43 jobs

@hakbailey hakbailey requested a review from alinabuzachis June 13, 2023 14:45
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/674f2493f68c4eb59246a8d95884f1fa

✔️ ansible-galaxy-importer SUCCESS in 4m 03s
✔️ build-ansible-collection SUCCESS in 14m 58s
✔️ ansible-test-splitter SUCCESS in 5m 03s
integration-amazon.aws-1 RETRY_LIMIT in 3m 27s
Skipped 43 jobs

@hakbailey hakbailey force-pushed the backup-plan-params-bugfix branch from fc0a06d to e391547 Compare June 14, 2023 14:03
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/7c48934cabbc4601918ae24f599e1cee

✔️ ansible-galaxy-importer SUCCESS in 3m 54s
✔️ build-ansible-collection SUCCESS in 13m 49s
✔️ ansible-test-splitter SUCCESS in 5m 36s
✔️ integration-amazon.aws-1 SUCCESS in 6m 28s
Skipped 43 jobs

@alinabuzachis alinabuzachis added the backport-6 PR should be backported to the stable-6 branch label Jun 14, 2023
@hakbailey hakbailey added the mergeit Merge the PR (SoftwareFactory) label Jun 21, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/5a8be33fcf4a4a0c8239df52e5e8c815

✔️ ansible-galaxy-importer SUCCESS in 4m 32s
✔️ build-ansible-collection SUCCESS in 14m 13s
✔️ ansible-test-splitter SUCCESS in 5m 12s
✔️ integration-amazon.aws-1 SUCCESS in 8m 38s
Skipped 43 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit ad953e8 into ansible-collections:main Jun 21, 2023
@patchback
Copy link

patchback bot commented Jun 21, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/ad953e83bfe609008d06a8a092fc910caa3493aa/pr-1611

Backported as #1620

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jun 21, 2023
Backup plan params bugfix

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
Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: Bikouo Aubin
(cherry picked from commit ad953e8)
hakbailey added a commit that referenced this pull request Jun 22, 2023
Backup plan params bugfix

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
Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: Bikouo Aubin
(cherry picked from commit ad953e8)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jun 22, 2023
[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
@hakbailey hakbailey deleted the backup-plan-params-bugfix branch August 14, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-6 PR should be backported to the stable-6 branch mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants