From e3a7792ac3798a588fb0a7f14b4d15029c06859c Mon Sep 17 00:00:00 2001 From: utkarshbhatthere Date: Mon, 10 Apr 2023 14:46:59 +0530 Subject: [PATCH] Comment Fixes Signed-off-by: utkarshbhatthere --- scripts/appS3.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/appS3.py b/scripts/appS3.py index 62ffad23..8fef69d1 100644 --- a/scripts/appS3.py +++ b/scripts/appS3.py @@ -1,4 +1,3 @@ -import os import string import time import random @@ -6,16 +5,10 @@ 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: @@ -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", @@ -89,6 +85,7 @@ 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) @@ -96,8 +93,5 @@ def rand_str(length: int): # 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)