-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Enhance/enable managed disk deletion async #347
Enhance/enable managed disk deletion async #347
Conversation
@KevinLoiseau
|
2a4beb1
to
d631952
Compare
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.
Make the changes suggested by following what has been done in server methods.
def destroy | ||
service.delete_managed_disk(resource_group_name, name) | ||
def destroy(async = false) | ||
service.delete_managed_disk(resource_group_name, name, async) |
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.
You need to check if the request is an asynchronous request or not and return the response accordingly. In case of a synchronous request the response will return as is. In case of an asynchronous request you will need to convert the response into a Fog::AsyncResponse object and return that. You can find how to do that here
@@ -4,11 +4,15 @@ module Compute | |||
class AzureRM | |||
# Real class for Compute Request | |||
class Real | |||
def delete_managed_disk(resource_group_name, disk_name) | |||
def delete_managed_disk(resource_group_name, disk_name, async) |
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.
Check whether the call sent is an asynchronous call or not and return the response accordingly. Check the delete method for server here.
end | ||
end | ||
|
||
def test_destroy_method_can_take_params_async |
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.
Update this unit test to reflect the changes you make above. Again, you can reference server unit tests for better understanding.
d631952
to
2e271c8
Compare
end | ||
|
||
def test_destroy_method_can_take_params_async | ||
|
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.
Extra empty line detected at method body beginning.
end | ||
|
||
def test_destroy_method_can_take_params_async | ||
|
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.
Extra empty line detected at method body beginning.
end | ||
|
||
def test_destroy_method_can_take_params_async | ||
|
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.
Extra empty line detected at method body beginning.
2e271c8
to
541958c
Compare
@bilal-naeem-confiz Excuse the tardly reply. Your requests are been done. |
@bilal-naeem-confiz can we have some news about this pull request ? |
@KevinLoiseau sorry for the late response. The PR looks good. I can see that there is a merge conflict in the |
541958c
to
e6cffc3
Compare
@bilal-naeem-confiz Thank you ! The conflict is fixed, up to you. |
Looks good to me @KevinLoiseau. Thanks for your contribution. Really appreciate it. |
Hi,
This little enhance permite to destroy a managed disk asynchronously, according to azure-sdk method (see: https://github.com/Azure/azure-sdk-for-ruby/blob/84fc2ecb6a4d9fd07bfed0182896901f8bf9df6b/management/azure_mgmt_compute/lib/2017-03-30/generated/azure_mgmt_compute/disks.rb#L240).
Result: