Example #1
0
    def test_should_get_connection_to_amazon_cloudfront_using_boto(self):
        with app.test_request_context():
            CloudFrontConnection = self.mocker.replace('boto.cloudfront.CloudFrontConnection')
            CloudFrontConnection(aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'], aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
            self.mocker.result('connected')
            self.mocker.replay()

            from awsmanager.util import ConnectionManager
            connection = ConnectionManager.get_cloudfront_connection()
            assert_equals('connected', connection)
            self.mocker.verify()
Example #2
0
def purge_paths():
    distribution_id = request.form["distribution"]
    paths = [p.strip() for p in request.form["paths"].split("\n")]
    connection = ConnectionManager.get_cloudfront_connection()
    batch = connection.create_invalidation_request(distribution_id, paths)
    return render_template("invalidation_sent.html", batch=batch)
Example #3
0
def show_purge_form():
    connection = ConnectionManager.get_cloudfront_connection()
    distributions = connection.get_all_distributions()
    return render_template("purge_form.html", distributions=distributions)
Example #4
0
def purge_paths():
    distribution_id = request.form['distribution']
    paths = [p.strip() for p in request.form['paths'].split('\n')]
    connection = ConnectionManager.get_cloudfront_connection()
    batch = connection.create_invalidation_request(distribution_id, paths)
    return render_template("invalidation_sent.html", batch=batch)
Example #5
0
def show_purge_form():
    connection = ConnectionManager.get_cloudfront_connection()
    distributions = connection.get_all_distributions()
    return render_template("purge_form.html", distributions=distributions)