diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3a804666..0434590f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -131,7 +131,7 @@ jobs: run: | set -eux sudo microceph.radosgw-admin user create --uid=test --display-name=test > keys.json - sudo python3 ./github/scripts/appS3.py http://localhost:80 keys.json --obj-num 2 + sudo python3 scripts/appS3.py http://localhost:80 keys.json --obj-num 2 - name: Upload artifacts if: always() diff --git a/docs/conf.py b/docs/conf.py index 814e6612..6bce3bb7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,8 +19,6 @@ templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'sphinxenv'] - - # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output diff --git a/.github/scripts/appS3.py b/scripts/appS3.py similarity index 86% rename from .github/scripts/appS3.py rename to scripts/appS3.py index d74a9868..04cb86ef 100644 --- a/.github/scripts/appS3.py +++ b/scripts/appS3.py @@ -50,13 +50,16 @@ def app_handle(args): for obj, size in objects: print("Object: {}/{} -> Size: {}MB".format(bucket_name, obj, size)) + # Cleanup (if asked for) + if not args.no_delete: + print("Performing Cleanup") + for obj, size in objects: + client.Object(bucket_name, obj).delete() def rand_str(length: int): - ret = "".join( + return "".join( random.choices(string.ascii_uppercase + string.digits, k=length) ) - # print("TEST {}".format(ret)) - return ret if __name__ == "__main__": @@ -81,6 +84,12 @@ def rand_str(length: int): default=1, help="Number of objects to upload to S3.", ) + argparse.add_argument( + "--no-delete", + type=bool, + default=False, + help="Setting this to true would not cleanup the pushed objects.", + ) argparse.set_defaults(func=app_handle) # Parse the args.