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

Support deletion of CloudObjectStoreObject #152

Merged
merged 1 commit into from
Mar 6, 2017

Conversation

miha-plesko
Copy link
Contributor

@miha-plesko miha-plesko commented Feb 27, 2017

Support deletion of CloudObjectStoreObject for Amazon provider.

Depends on (from other repos):

Will enable merge of:

@miha-plesko
Copy link
Contributor Author

@miq-bot add_label enhancement, wip

@@ -0,0 +1,8 @@
module ManageIQ::Providers::Amazon::CloudManager::CloudObjectStoreContainer::Operations
extend ActiveSupport::Concern

Choose a reason for hiding this comment

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

@miha-plesko
I think this should be:

supports :delete do
  unsupported_reason_add(:delete, "CloudObjectStoreContainer has no #{ui_lookup(:table => "ext_management_systems")}, unable to delete it" unless ext_management_system
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like what you suggest, thanks!

extend ActiveSupport::Concern

def raw_delete
raise "CloudObjectStoreContainer has no #{ui_lookup(:table => "ext_management_systems")}, unable to delete it" unless ext_management_system

Choose a reason for hiding this comment

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

@miha-plesko - then this raise can go away.

def raw_delete
raise "CloudObjectStoreContainer has no #{ui_lookup(:table => "ext_management_systems")}, unable to delete it" unless ext_management_system
with_provider_object(&:delete!)
end

Choose a reason for hiding this comment

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

@miha-plesko - is there a status property that needs to be updated to reflect a deletion is in progress until the next refresh happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Unfortunately ATM there is no status property available. We should definitely support this in the future.

def raw_delete
raise "CloudObjectStoreObject has no #{ui_lookup(:table => "ext_management_systems")}, unable to delete it" unless ext_management_system
raise "CloudObjectStoreObject has no #{ui_lookup(:table => "cloud_object_store_container")}, unable to delete it" unless cloud_object_store_container
with_provider_object(&:delete)

Choose a reason for hiding this comment

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

@miha-plesko - same comment applies to these raise exceptions

Copy link
Contributor Author

@miha-plesko miha-plesko left a comment

Choose a reason for hiding this comment

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

@bronaghs Thank you very much for the review. Your comments helped me a lot. I've updated the code and repushed all the PRs that I've pinged you for and I think that code is notably better now 😄

I'd kindly ask you to perform second pass.

@@ -0,0 +1,8 @@
module ManageIQ::Providers::Amazon::CloudManager::CloudObjectStoreContainer::Operations
extend ActiveSupport::Concern

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like what you suggest, thanks!

def raw_delete
raise "CloudObjectStoreContainer has no #{ui_lookup(:table => "ext_management_systems")}, unable to delete it" unless ext_management_system
with_provider_object(&:delete!)
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Unfortunately ATM there is no status property available. We should definitely support this in the future.

@miq-bot
Copy link
Member

miq-bot commented Mar 3, 2017

This pull request is not mergeable. Please rebase and repush.

Support deletion of CloudObjectStoreObject for Amazon provider.

Signed-off-by: Miha Pleško <[email protected]>
@miq-bot
Copy link
Member

miq-bot commented Mar 6, 2017

Checked commit miha-plesko@a7676a4 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 0 offenses detected
Everything looks good. 🍰

@miha-plesko miha-plesko changed the title [WIP] Delete CloudObjectStoreObject Support deletion of CloudObjectStoreObject Mar 6, 2017
@miq-bot miq-bot removed the wip label Mar 6, 2017
Copy link
Member

@durandom durandom left a comment

Choose a reason for hiding this comment

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

LGTM 🏆

@blomquisg can you merge this and the related core PR?

@bronaghs bronaghs self-assigned this Mar 6, 2017
@blomquisg blomquisg merged commit a3d0495 into ManageIQ:master Mar 6, 2017
@blomquisg blomquisg added this to the Sprint 56 Ending Mar 13, 2017 milestone Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants