You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by lf...@apache.org on 2020/02/20 15:01:54 UTC
[incubator-dlab] branch DLAB-1531 updated: DLAB-1531 updated code
This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch DLAB-1531
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-1531 by this push:
new 933c100 DLAB-1531 updated code
933c100 is described below
commit 933c100f4dce68e034b418aa4146ea59321f8dad
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Thu Feb 20 17:01:31 2020 +0200
DLAB-1531 updated code
---
infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 4 ++--
.../src/general/scripts/aws/common_create_bucket.py | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index 6ec2396..adb2661 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -66,7 +66,7 @@ def put_to_bucket(bucket_name, local_file, destination_file):
return False
-def create_s3_bucket(bucket_name, bucket_tags, region):
+def create_s3_bucket(bucket_name, bucket_tags, region, bucket_name_tag):
try:
s3 = boto3.resource('s3', config=Config(signature_version='s3v4'))
if region == "us-east-1":
@@ -94,7 +94,7 @@ def create_s3_bucket(bucket_name, bucket_tags, region):
}
)
tagging = bucket.Tagging()
- tagging.put(Tagging={'TagSet': bucket_tags})
+ tagging.put(Tagging={'TagSet': tags})
tagging.reload()
return bucket.name
except Exception as err:
diff --git a/infrastructure-provisioning/src/general/scripts/aws/common_create_bucket.py b/infrastructure-provisioning/src/general/scripts/aws/common_create_bucket.py
index 71a5456..207af06 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/common_create_bucket.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/common_create_bucket.py
@@ -32,6 +32,7 @@ parser = argparse.ArgumentParser()
parser.add_argument('--bucket_name', type=str, default='')
parser.add_argument('--bucket_tags', type=str, default='')
parser.add_argument('--region', type=str, default='')
+parser.add_argument('--bucket_name_tag', type=str, default='')
args = parser.parse_args()
@@ -41,7 +42,7 @@ if __name__ == "__main__":
bucket = get_bucket_by_name(args.bucket_name)
if bucket == '':
print("Creating bucket {0} with tags {1}.".format(args.bucket_name, args.bucket_tags))
- bucket = create_s3_bucket(args.bucket_name, args.bucket_tags, args.region)
+ bucket = create_s3_bucket(args.bucket_name, args.bucket_tags, args.region, args.bucket_name_tag)
else:
print("REQUESTED BUCKET ALREADY EXISTS")
print("BUCKET_NAME {}".format(bucket))
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org