azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

[Compute Gallery] Typo in file test_mgmt_compute_galleries.py

Open yangchengs opened this issue 1 year ago • 9 comments

  • Package Name:
  • azure-mgmt-compute
  • Package Version:
  • latest
  • Operating System:
  • Python Version: 3.8

Describe the bug Issue 1: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_galleries.py

Line 137 hyper_vgeneration should be hyper_v_generation

Issue 2: If I run delete version and delete gallery image definition in sequence, there is exception thrown: azure.core.exceptions.ResourceExistsError: (CannotDeleteResource) Can not delete resource before nested resources are deleted.

It seems the clean work did not complete, if I put code to sleep 10 seconds, it will succeed.

print("delete image version") result = compute_client.gallery_image_versions.begin_delete(resource_group, GALLERY_NAME, image_definition, "1.0.2") result = result.result() print(result)

print("delete image definition") result = compute_client.gallery_images.begin_delete(resource_group, GALLERY_NAME, image_definition) result = result.result() print(result)

yangchengs avatar Aug 02 '22 05:08 yangchengs

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Aug 02 '22 16:08 ghost

@yangchengs We are looking into it and get back to you for any additional information.

SaurabhSharma-MSFT avatar Aug 02 '22 17:08 SaurabhSharma-MSFT

@yangchengs I have submitted a PR to fix your 1st issue. Regarding 2nd issue, like you said you may have to wait for some time after deleting image versions before deleting image definitions. Did you try doing the same using CLI if it gets deleted without waiting.

SaurabhSharma-MSFT avatar Aug 03 '22 23:08 SaurabhSharma-MSFT

@SaurabhSharma-MSFT I test az command for several times but cannot reproduce the same issue, the az command seems to be good.

az sig image-version delete --resource-group yangshenrg001 --gallery-name gallery1 --gallery-image-definition imagedefinition --gallery-image-version 1.0.2 az sig image-definition delete --resource-group yangshenrg001 --gallery-name gallery1 --gallery-image-definition imagedefinition

yangchengs avatar Aug 04 '22 07:08 yangchengs

Hi @yangchengs. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

ghost avatar Aug 05 '22 19:08 ghost

Hi @yangchengs, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

ghost avatar Aug 12 '22 22:08 ghost

/unresolve

yangchengs avatar Aug 13 '22 02:08 yangchengs

@SaurabhSharma-MSFT can you check the second issue? I tested az cli and it works good.

yangchengs avatar Aug 13 '22 02:08 yangchengs

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @avirishuv, @vaibhav-agar, @amjads1.

Issue Details
  • Package Name:
  • azure-mgmt-compute
  • Package Version:
  • latest
  • Operating System:
  • Python Version: 3.8

Describe the bug Issue 1: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute_galleries.py

Line 137 hyper_vgeneration should be hyper_v_generation

Issue 2: If I run delete version and delete gallery image definition in sequence, there is exception thrown: azure.core.exceptions.ResourceExistsError: (CannotDeleteResource) Can not delete resource before nested resources are deleted.

It seems the clean work did not complete, if I put code to sleep 10 seconds, it will succeed.

print("delete image version") result = compute_client.gallery_image_versions.begin_delete(resource_group, GALLERY_NAME, image_definition, "1.0.2") result = result.result() print(result)

print("delete image definition") result = compute_client.gallery_images.begin_delete(resource_group, GALLERY_NAME, image_definition) result = result.result() print(result)

Author: yangchengs
Assignees: SaurabhSharma-MSFT
Labels:

question, Compute, Service Attention, Mgmt, customer-reported, needs-team-attention

Milestone: -

ghost avatar Sep 21 '22 18:09 ghost

@yangchengs - It looks like an expected behavior as the parent resource cannot be deleted while the child resource still is getting deleted. Let me validate and update.

sandeepraichura avatar Sep 29 '22 17:09 sandeepraichura

@yangchengs - This is an expected behavior and by design as you have to wait few seconds for the child resource to be deleted before the parent resource can be deleted. Closing this, but please do reopen if you see any concerns.

sandeepraichura avatar Sep 29 '22 19:09 sandeepraichura