Skip to content

Commit c648dda

Browse files
committed
fix Region handling
1 parent 385af62 commit c648dda

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

travel/main.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
type hop struct {
1414
Profile string
1515
Account string
16+
Region string
1617
Role string
1718
Mfa bool
1819
}
@@ -130,7 +131,7 @@ func (v *voyage) loadCreds(i Itinerary) error {
130131
}
131132
}
132133
c, err = a.ExecuteWithCreds(c)
133-
c.Region = thisHop.Account.Region
134+
c.Region = thisHop.Region
134135
if err != nil {
135136
return err
136137
}
@@ -140,7 +141,15 @@ func (v *voyage) loadCreds(i Itinerary) error {
140141
}
141142

142143
func parseHops(stack *[]hop, cp cartogram.Pack, a cartogram.Account, r string) error {
143-
*stack = append(*stack, hop{Account: a.Account, Role: r, Mfa: a.Roles[r].Mfa})
144+
*stack = append(
145+
*stack,
146+
hop{
147+
Account: a.Account,
148+
Region: a.Region,
149+
Role: r,
150+
Mfa: a.Roles[r].Mfa,
151+
},
152+
)
144153
accountMatch := cartogram.AccountRegex.FindStringSubmatch(a.Source)
145154
if len(accountMatch) != 4 {
146155
*stack = append(*stack, hop{Profile: a.Source})

0 commit comments

Comments
 (0)