diff --git a/lib/remote_storage/swift.rb b/lib/remote_storage/swift.rb index 3c5bb12..fa84347 100644 --- a/lib/remote_storage/swift.rb +++ b/lib/remote_storage/swift.rb @@ -383,7 +383,13 @@ module RemoteStorage end def container_url_for(user) - "#{base_url}/#{container_for(user)}" + user_container_url = "#{base_url}/#{container_for(user)}" + res = do_head_request(user_container_url) + # User before container migration + return user_container_url if res.status == 200 + rescue RestClient::ResourceNotFound + # User after container migration + "#{base_url}/rs:documents:#{settings.environment.to_s}/#{user}" end def url_for_key(user, directory, key)