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

[vm-repair] Adding repair-and-restore one command flow for fstab scripts #6244

Merged
merged 19 commits into from
Jun 27, 2023

Conversation

haagha
Copy link
Member

@haagha haagha commented May 1, 2023


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@yonzhan
Copy link
Collaborator

yonzhan commented May 1, 2023

vm-repair

examples:
- name: Repair and restore a VM.
text: >
az vm repair repair-and-restore --name "vmrepairtest" --resource-group "MyResourceGroup" --verbose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
az vm repair repair-and-restore --name "vmrepairtest" --resource-group "MyResourceGroup" --verbose
az vm repair repair-and-restore --name vmrepairtest --resource-group MyResourceGroup --verbose

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit change

Comment on lines 426 to 429
namespace.repair_username = "azureuser"
validate_vm_username(namespace.repair_username, is_linux)
namespace.repair_password = "!AzureUser@123"
validate_vm_password(namespace.repair_password, is_linux)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask if this operation tries to set the default values of repair_username and repair_password?

Suggested change
namespace.repair_username = "azureuser"
validate_vm_username(namespace.repair_username, is_linux)
namespace.repair_password = "!AzureUser@123"
validate_vm_password(namespace.repair_password, is_linux)
if not namespace.repair_username:
namespace.repair_username = "azureuser"
validate_vm_username(namespace.repair_username, is_linux)
if not namespace.repair_password:
namespace.repair_password = "!AzureUser@123"
validate_vm_password(namespace.repair_password, is_linux)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for suggesting but I fixed this to remove the default values.

return urns[0]


def _suse_image_selector_gen2(distro):
fetch_urn_command = 'az vm image list --publisher SUSE --offer {offer} --sku gen2 --verbose --all --query "[].urn | reverse(sort(@))" -o json'.format(offer=distro)
logger.info('Fetching compatible SUSE OS images from gallery...')
# logger.info('Fetching compatible SUSE OS images from gallery...')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to remove deprecated code instead of commenting them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@yanzhudd
Copy link
Contributor

Please add test for the new feature and fix the CI.

@haagha
Copy link
Member Author

haagha commented Jun 20, 2023

@yanzhudd Thanks for reviewing. I made the changes suggested.

@yanzhudd yanzhudd merged commit 3bb5485 into Azure:main Jun 27, 2023
13 checks passed
@azclibot
Copy link
Collaborator

[Release] Update index.json for extension [ vm-repair ] : https://dev.azure.com/azclitools/internal/_build/results?buildId=67280&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants