You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2021/04/06 09:08:12 UTC
[incubator-datalab] branch DATALAB-2091 updated: [DATALAB-2091]:
changed aws action create_iam_role
This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch DATALAB-2091
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/DATALAB-2091 by this push:
new f47f7c9 [DATALAB-2091]: changed aws action create_iam_role
f47f7c9 is described below
commit f47f7c9b850157ec0e2f8e31943f48c0824a7acb
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Tue Apr 6 12:08:01 2021 +0300
[DATALAB-2091]: changed aws action create_iam_role
---
infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 7 +++----
infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py | 2 --
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index 1535c40..f2f6f64 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -591,7 +591,7 @@ def create_iam_role(role_name, role_profile, region, service='ec2', tag=None, us
if service == 'ec2':
try:
conn.create_instance_profile(InstanceProfileName=role_profile)
- waiter = conn.get_waiter('instance_profile_exists').stdout
+ waiter = conn.get_waiter('instance_profile_exists')
waiter.wait(InstanceProfileName=role_profile)
except botocore.exceptions.ClientError as e_profile:
if e_profile.response['Error']['Code'] == 'EntityAlreadyExists':
@@ -1499,8 +1499,8 @@ def get_gitlab_cert(bucket, certfile):
def create_aws_config_files(generate_full_config=False):
try:
aws_user_dir = os.environ['AWS_DIR']
- subprocess.run("rm -rf " + aws_user_dir + " 2>&1", shell=True, check=True)
- subprocess.run("mkdir -p " + aws_user_dir + " 2>&1", shell=True, check=True)
+ subprocess.run("rm -rf " + aws_user_dir, shell=True, check=True)
+ subprocess.run("mkdir -p " + aws_user_dir, shell=True, check=True)
with open(aws_user_dir + '/config', 'w') as aws_file:
aws_file.write("[default]\n")
@@ -1514,7 +1514,6 @@ def create_aws_config_files(generate_full_config=False):
subprocess.run("chmod 600 " + aws_user_dir + "/*" + " 2>&1", shell=True, check=True)
subprocess.run("chmod 550 " + aws_user_dir + " 2>&1", shell=True, check=True)
- subprocess.run("cat " + aws_user_dir + "/credentials", shell=True, check=True)
return True
except Exception as err:
print('Error: {0}'.format(err))
diff --git a/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py b/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
index b2c58e2..bee2e3f 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
@@ -48,10 +48,8 @@ if __name__ == "__main__":
logging.info('[CREATE AWS CONFIG FILE]')
print('[CREATE AWS CONFIG FILE]')
if 'aws_access_key' in os.environ and 'aws_secret_access_key' in os.environ:
- print('===== 1')
datalab.actions_lib.create_aws_config_files(generate_full_config=True)
else:
- print('===== 2')
datalab.actions_lib.create_aws_config_files()
except Exception as err:
logging.info('Unable to create configuration')
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org