Skip to content

Commit

Permalink
Comment Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: utkarshbhatthere <[email protected]>
  • Loading branch information
UtkarshBhatthere committed Apr 24, 2023
1 parent 4b0bde1 commit e3a7792
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions scripts/appS3.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import os
import string
import time
import random
import boto3
import json
import argparse

# seed random
random.seed(time.time())


def app_handle(args):
keys_path = args.keys
endpoint = args.endpoint
if not os.path.isfile(keys_path):
print("Provided key path {} is incorrect.".format(keys_path))
return

# Fetch Auth
with open(keys_path, 'r') as keys_file:
Expand Down Expand Up @@ -64,6 +57,9 @@ def rand_str(length: int):


if __name__ == "__main__":
# seed random
random.seed(time.time())

argparse = argparse.ArgumentParser(
description="An application which uses S3 for storage",
epilog="Ex: python3 app.py --keys keys.txt",
Expand All @@ -89,15 +85,13 @@ def rand_str(length: int):
"--no-delete",
type=bool,
default=False,
action="store_true",
help="Setting this to true would not cleanup the pushed objects.",
)
argparse.set_defaults(func=app_handle)

# Parse the args.
args = argparse.parse_args()

if not args.keys or not args.endpoint:
print("Please provide --keys and --endpoint.")

# Call the subcommand.
args.func(args)

0 comments on commit e3a7792

Please sign in to comment.