Last active
December 23, 2015 19:08
-
-
Save benjohnson77/6680086 to your computer and use it in GitHub Desktop.
transferring 2TB of data from Rackspace cloud to Google Storage
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
def find_container(container_name, obj = nil) | |
container_info = requested_container_info(container_name) | |
container_name = clean_container_name(container_name) | |
parts = [prefix] | |
parts << container_name unless container_name == 'default' | |
name = parts.compact.join('-') | |
# NOTE: getting the container creates it if it does not exist. even | |
# though name doesn't access the container instance stored here, we | |
# need to leave this call here so the container will be created. | |
container = attempt(RETRY_THRESHOLD, :get_container!, name, container_name) | |
case container_info | |
when :container | |
raise "Failed to fetch container: #{name}" unless container | |
container | |
when :name | |
name | |
when :url | |
puts container_base_url | |
mappings.get(name) || mappings.set(name, container).try(:cdn_url) | |
when :url_ssl | |
mappings.get(name, true) || mappings.set(name, container).cdn_ssl_url | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment