File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -180,8 +180,7 @@ def assume_role(self):
180
180
try :
181
181
if len (self .assertion .roles ()) > 1 :
182
182
raise MultipleRoles
183
- else :
184
- self .role = self .assertion .roles ()[0 ]
183
+ self .role = self .assertion .roles ()[0 ]
185
184
except xml .etree .ElementTree .ParseError :
186
185
log .error ('Could not find any Role in the SAML assertion' )
187
186
log .error (self .assertion .__dict__ )
Original file line number Diff line number Diff line change @@ -170,13 +170,13 @@ def main(argv):
170
170
time .sleep (15 )
171
171
continue
172
172
173
- # Only set up the session if it's still None
174
- if session is None :
175
- assertion = okta_client .get_assertion (appid = config .appid ,
176
- apptype = 'amazon_aws' )
177
- session = aws .Session (assertion , profile = config .name )
178
-
179
173
try :
174
+ # Only set up the session if it's still None
175
+ if session is None :
176
+ assertion = okta_client .get_assertion (appid = config .appid ,
177
+ apptype = 'amazon_aws' )
178
+ session = aws .Session (assertion , profile = config .name )
179
+
180
180
log .info ('Getting SAML Assertion from {org}' .format (
181
181
org = config .org ))
182
182
session .assume_role ()
You can’t perform that action at this time.
0 commit comments