Commit 7c547c4a authored by Ciarán Ó Rourke's avatar Ciarán Ó Rourke
Browse files

Can supply filename as command line argument

parent 8d8a71d0
......@@ -2,9 +2,12 @@ import boto3
import uuid
import sys
file_string="EmperorWu.txt"
key_string="ThisIsMyKey3"
if(len(sys.argv) > 1):
key_string = str(sys.argv[1])
if(len(sys.argv) > 2):
file_string = str(sys.argv[2])
def create_bucket_name(bucket_prefix):
# The generated bucket name must be between 3 and 63 chars long
......@@ -45,7 +48,7 @@ first_bucket_name = "ichec.phobos.7a3d12c6-632b-4291-b87e-07badca60cd0"
first_file_name = "ThisIsMyKey1"
s3_client.upload_file(
Filename="EmperorWu.txt", Bucket=first_bucket_name,
Filename=file_string, Bucket=first_bucket_name,
Key=key_string)
# s3_client.download_file(first_bucket_name, first_file_name).download_file(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment