Sha256: a494e6806dfcf4340fc43c203e669941c0ba601c139b7fbd02f2f00bbd77e511

Contents?: true

Size: 784 Bytes

Versions: 3

Compression:

Stored size: 784 Bytes

Contents

module S3Secure::AccessLogs
  class List < Base
    def run
      presenter = CliFormat::Presenter.new(@options)
      presenter.header = ["Bucket", "Access Logs?"]

      buckets.each do |bucket|
        $stderr.puts "Getting access log setting for bucket #{bucket.color(:green)}"
        show = Show.new(bucket: bucket)

        enabled = show.logging_enabled?
        row = [bucket, enabled]
        if @options[:enabled].nil?
          presenter.rows << row # always show policy
        elsif @options[:enabled]
          presenter.rows << row if enabled # only show if bucket has some encryption rules
        else
          presenter.rows << row unless enabled # only show if bucket doesnt have any encryption rules
        end
      end

      presenter.show
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
s3-secure-0.7.0 lib/s3_secure/access_logs/list.rb
s3-secure-0.6.1 lib/s3_secure/access_logs/list.rb
s3-secure-0.6.0 lib/s3_secure/access_logs/list.rb