Allow both ports and networks in openstack builder
Current code would throw an index out of range exception when trying to access `s.Networks[len(s.Networks)]` when `len(s.Ports)>0` and would ignore the first `len(s.Ports)` entries of `s.Networks`, fix by shifting access to `s.Networks` back by `len(s.Ports)` so that the final read is `networks[len(s.Networks)+len(s.Ports)-1].UUID=s.Networks[len(s.Networks)+len(s.Ports)-1-len(s.Ports)]` which is necessarily the last member of `s.Networks`
This commit is contained in:
parent
605180f058
commit
cbbbc451b5
|
@ -48,7 +48,7 @@ func (s *StepRunSourceServer) Run(_ context.Context, state multistep.StateBag) m
|
|||
networks[i].Port = s.Ports[i]
|
||||
}
|
||||
for ; i < len(networks); i++ {
|
||||
networks[i].UUID = s.Networks[i]
|
||||
networks[i].UUID = s.Networks[i-len(s.Ports)]
|
||||
}
|
||||
|
||||
userData := []byte(s.UserData)
|
||||
|
|
Loading…
Reference in New Issue