Skip to content

Commit

Permalink
whoami: Remove external org ID if empty
Browse files Browse the repository at this point in the history
On some environments there is no external ID associated with an
organization.
  • Loading branch information
vkareh committed Jun 8, 2022
1 parent 3fed02b commit 8e68200
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/whoami/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ func run(_ *cobra.Command, _ []string) {
"OCM Account Username: %s\n"+
"OCM Account Email: %s\n"+
"OCM Organization ID: %s\n"+
"OCM Organization Name: %s\n"+
"OCM Organization External ID: %s\n",
"OCM Organization Name: %s\n",
awsCreator.AccountID,
awsRegion,
awsCreator.ARN,
Expand All @@ -146,8 +145,13 @@ func run(_ *cobra.Command, _ []string) {
account.Email(),
account.Organization().ID(),
account.Organization().Name(),
account.Organization().ExternalID(),
)
if account.Organization().ExternalID() != "" {
fmt.Printf(""+
"OCM Organization External ID: %s\n",
account.Organization().ExternalID(),
)
}
fmt.Println()
}

Expand Down

0 comments on commit 8e68200

Please sign in to comment.