Ejemplo n.º 1
0
    print("Checking for response message.")

    resp_queue = sqs.connect_to_region(region).create_queue(proc_name +
                                                            "_response")

    if resp_queue.count() > 0:
        mess = resp_queue.read(10)
        content = json.loads(mess.get_body())
        print("Saving content.")
        with open("tests/test_response.txt", "w") as f:
            json.dump(content, f)
    else:
        print("No message received!")

    # Now download the output file
    download_from_s3("data_products/*",
                     proc_name,
                     aws_access={
                         "aws_access_key_id": key,
                         "aws_secret_access_key": secret
                     },
                     output_dir="tests/")

except Exception as e:
    print("Failed with :")
    print(e)

queue.delete()
resp_queue.delete()
remove_s3_bucket(proc_name, s3.connection.S3Connection())
Ejemplo n.º 2
0
        print("Reached time limit. Terminating after 1 min.")

    inst.terminate()

    print("Checking for response message.")

    resp_queue = sqs.connect_to_region(region).create_queue(proc_name + "_response")

    if resp_queue.count() > 0:
        mess = resp_queue.read(10)
        content = json.loads(mess.get_body())
        print("Saving content.")
        with open("tests/test_response.txt", "w") as f:
            json.dump(content, f)
    else:
        print("No message received!")

    # Now download the output file
    download_from_s3("data_products/*", proc_name,
                     aws_access={"aws_access_key_id": key,
                                 "aws_secret_access_key": secret},
                     output_dir="tests/")

except Exception as e:
    print("Failed with :")
    print(e)

queue.delete()
resp_queue.delete()
remove_s3_bucket(proc_name, s3.connection.S3Connection())
#!/usr/bin/env python

''' Remove an AWS S3 bucket with data in it (added with upload_data_AWS.py)
'''
import sys
sys.path.append('PATH_TO_AWS_CONTROLLER')
from upload_download_s3 import remove_s3_bucket
from boto.s3.connection import S3Connection

bucket_name='BUCKET_NAME'
aws_access={'aws_access_key_id': 'ACCESS_KEY_HERE',
 'aws_secret_access_key': 'SECRET_ACCESS_KEY_HERE'}
conn=conn = S3Connection(**aws_access)

remove_s3_bucket(bucket_name,conn)
Ejemplo n.º 4
0
#!/usr/bin/env python
''' Remove an AWS S3 bucket with data in it (added with upload_data_AWS.py)
'''
import sys
sys.path.append('PATH_TO_AWS_CONTROLLER')
from upload_download_s3 import remove_s3_bucket
from boto.s3.connection import S3Connection

bucket_name = 'BUCKET_NAME'
aws_access = {
    'aws_access_key_id': 'ACCESS_KEY_HERE',
    'aws_secret_access_key': 'SECRET_ACCESS_KEY_HERE'
}
conn = conn = S3Connection(**aws_access)

remove_s3_bucket(bucket_name, conn)