Skip to content

Commit

Permalink
Merge pull request #1172 from blackliner/patch-1
Browse files Browse the repository at this point in the history
Always print roles with list-roles
  • Loading branch information
mapkon authored Dec 3, 2023
2 parents a9a16c7 + f3e5743 commit 8c57a29
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cmd/saml2aws/commands/list_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,7 @@ func ListRoles(loginFlags *flags.LoginExecFlags) error {
}

func listRoles(awsRoles []*saml2aws.AWSRole, samlAssertion string, loginFlags *flags.LoginExecFlags) error {
if len(awsRoles) == 1 {
log.Println("")
log.Println("Only one role to assume. Will be automatically assumed on login")
log.Println(awsRoles[0].RoleARN)
return nil
} else if len(awsRoles) == 0 {
if len(awsRoles) == 0 {
return errors.New("no roles available")
}

Expand Down

0 comments on commit 8c57a29

Please sign in to comment.