-
Notifications
You must be signed in to change notification settings - Fork 3k
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] az backup
: Add support for new AFS Vault Standard Policies
#30531
base: dev
Are you sure you want to change the base?
Conversation
️✔️AzureCLI-FullTest
|
|
rule | cmd_name | rule_message | suggest_message |
---|---|---|---|
backup policy set | cmd backup policy set added parameter yes |
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
20423fe
to
de7c8b2
Compare
@yonzhan @zhoxing-ms Could you please re-trigger the pipeline, I want to download private build for bug bash |
src/azure-cli/azure/cli/command_modules/backup/tests/latest/preparers.py
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just need a couple of minor changes
Please refer to this document Submitting Pull Requests to improve the PR title |
az backup
: Add support for new AFS Vault Standard Policies
existing_backup_management_type = existing_policy.properties.backup_management_type | ||
new_backup_management_type = new_policy.properties.backup_management_type | ||
if existing_backup_management_type != new_backup_management_type: | ||
raise CLIError("BackupManagementType cannot be different than the existing type.") | ||
# vault -> snapshot | ||
if new_backup_management_type.lower() == 'azurestorage' and hasattr(existing_policy.properties, 'vault_retention_policy') and existing_policy.properties.vault_retention_policy is not None and hasattr(new_policy.properties, 'retention_policy') and new_policy.properties.retention_policy is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newly added judgment logic is too complex. Could it be abstracted as a variable to reduce the complexity of code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhoxing-ms Thanks for the feedback, I have refactored the code
Please create a new policy for snapshot-only backups. | ||
""") | ||
# snapshot -> vault | ||
if new_backup_management_type.lower() == 'azurestorage' and hasattr(existing_policy.properties, 'retention_policy') and existing_policy.properties.retention_policy is not None and hasattr(new_policy.properties, 'vault_retention_policy') and new_policy.properties.vault_retention_policy is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
…eorges/azure-cli into users/ianna/afsVaultPolicy
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a
: Make some customer-facing breaking change[Component Name 2]
az command b
: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.