Skip to content

Commit

Permalink
Merge pull request ManageIQ#14082 from xlab-si/empty_aws_bucket
Browse files Browse the repository at this point in the history
Support operation `clear` on CloudObjectStoreContainer
  • Loading branch information
agrare authored Mar 7, 2017
2 parents ad4e7ee + 92e7dfb commit 6d90d8d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/cloud_object_store_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ class CloudObjectStoreContainer < ApplicationRecord
alias_attribute :name, :key

supports_not :delete, :reason => N_("Delete operation is not supported.")
supports_not :cloud_object_store_container_clear
end
8 changes: 8 additions & 0 deletions app/models/cloud_object_store_container/operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ def delete_cloud_object_store_container
def raw_delete
raise NotImplementedError, _("must be implemented in subclass")
end

def cloud_object_store_container_clear
raw_cloud_object_store_container_clear
end

def raw_cloud_object_store_container_clear
raise NotImplementedError, _("must be implemented in subclass")
end
end
1 change: 1 addition & 0 deletions app/models/mixins/supports_feature_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ module SupportsFeatureMixin
# FIXME: this is just a internal helper and should be refactored
:control => 'Basic control operations',
:cloud_tenant_mapping => 'CloudTenant mapping',
:cloud_object_store_container_clear => 'Clear Object Store Container',
:create => 'Creation',
:backup_create => 'CloudVolume backup creation',
:backup_restore => 'CloudVolume backup restore',
Expand Down
4 changes: 4 additions & 0 deletions db/fixtures/miq_product_features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@
:description: Delete Object Store Containers
:feature_type: admin
:identifier: cloud_object_store_container_delete
- :name: Clear
:description: Clear Object Store Containers
:feature_type: admin
:identifier: cloud_object_store_container_clear

# CloudObjectStoreObject
- :name: Cloud Objects
Expand Down
2 changes: 2 additions & 0 deletions db/fixtures/miq_user_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
- ontap_storage_volume
- catalog
- cloud_network
- cloud_object_store_container
- cloud_object_store_object
- control_explorer
- dashboard
- datacenter
Expand Down

0 comments on commit 6d90d8d

Please sign in to comment.