lib/s3_secure/encryption/disable.rb in s3-secure-0.4.2 vs lib/s3_secure/encryption/disable.rb in s3-secure-0.5.0
- old
+ new
@@ -1,18 +1,14 @@
class S3Secure::Encryption
class Disable < Base
def run
- @s3 = s3_regional_client(@bucket)
+ show = Show.new(@options)
- list = S3Secure::Encryption::List.new(@options)
- list.set_s3(@s3)
-
- rules = list.get_encryption_rules(@bucket)
- if rules
- @s3.delete_bucket_encryption(bucket: @bucket) # returns resp = #<struct Aws::EmptyStructure>
+ if show.enabled?
+ s3.delete_bucket_encryption(bucket: @bucket) # returns resp = #<struct Aws::EmptyStructure>
puts "Bucket #{@bucket} encryption has been removed"
else
- puts "WARN: Bucket #{@bucket} is not configured with encryption at the bucket level".color(:yellow)
+ puts "Bucket #{@bucket} is not configured with encryption at the bucket level"
end
end
end
end