Sha256: 720c1a54386227f6ca0305e769cfa9fe65a2cd44a4bc47fe24bf0fd319bf97ea
Contents?: true
Size: 1.36 KB
Versions: 29
Compression:
Stored size: 1.36 KB
Contents
module Heirloom class Verifier def initialize(args) @config = args[:config] @name = args[:name] @logger = @config.logger end def buckets_exist?(args) bucket_prefix = args[:bucket_prefix] regions = args[:regions] result = true regions.each do |region| unless bucket_exists? :region => region, :bucket_prefix => bucket_prefix result = false end end result end def bucket_exists?(args) bucket_prefix = args[:bucket_prefix] region = args[:region] bucket = "#{bucket_prefix}-#{region}" s3 ||= AWS::S3.new :config => @config, :region => region if s3.get_bucket bucket @logger.debug "Bucket '#{bucket}' exists in '#{region}'." true else @logger.debug "Bucket '#{bucket}' does not exist in '#{region}'." false end end def domain_exists? domain = "heirloom_#{@name}" region = @config.metadata_region if sdb.domain_exists? domain @logger.debug "Domain '#{@name}' exists in '#{region}'." true else @logger.debug "Domain '#{@name}' does not exist in '#{region}'." false end end private def sdb @sdb ||= AWS::SimpleDB.new :config => @config end end end
Version data entries
29 entries across 29 versions & 1 rubygems