This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DATALAB-2333
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/DATALAB-2333 by this push:
     new 5f66017  [DATALAB-2333]: added leftover policy detach from the role
5f66017 is described below

commit 5f66017a460cfb10a6cf2d95ed33ee93b1304f88
Author: leonidfrolov <[email protected]>
AuthorDate: Mon May 24 16:07:55 2021 +0300

    [DATALAB-2333]: added leftover policy detach from the role
---
 infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py 
b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index 5fe23e9..4decc7f 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -957,8 +957,7 @@ def remove_all_iam_resources(instance_type, 
project_name='', endpoint_name=''):
                     attached_role_policies = 
client.list_attached_role_policies(RoleName=iam_role)
                     if attached_role_policies:
                         for policy in 
attached_role_policies['AttachedPolicies']:
-                            print('========1')
-                            print(policy)
+                            client.detach_role_policy(RoleName=iam_role, 
PolicyArn=policy['PolicyArn'])
                     role_profiles = 
client.list_instance_profiles_for_role(RoleName=iam_role).get('InstanceProfiles')
                     if role_profiles:
                         for i in role_profiles:

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to