-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from miha-plesko/delete_aws_object
Support deletion of CloudObjectStoreObject
- Loading branch information
Showing
4 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/models/manageiq/providers/amazon/storage_manager/s3/cloud_object_store_object.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class ManageIQ::Providers::Amazon::StorageManager::S3::CloudObjectStoreObject < ::CloudObjectStoreObject | ||
supports :delete do | ||
unless ext_management_system | ||
unsupported_reason_add(:delete, _("The Storage Object is not connected to an active %{table}") % { | ||
:table => ui_lookup(:table => "ext_management_systems") | ||
}) | ||
end | ||
|
||
unless cloud_object_store_container | ||
unsupported_reason_add(:delete, _("The Storage Object is not connected to an active %{table}") % { | ||
:table => ui_lookup(:table => "cloud_object_store_containers") | ||
}) | ||
end | ||
end | ||
|
||
def provider_object(connection = nil) | ||
connection ||= ext_management_system.connect | ||
connection.bucket(cloud_object_store_container.ems_ref).object(key) | ||
end | ||
|
||
def raw_delete | ||
with_provider_object(&:delete) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters