Merge pull request #14139 from ioito/hotfix/qx-openstack-nic

fix(region): openstack vm nic
This commit is contained in:
Zexi Li
2022-04-26 10:21:22 +08:00
committed by GitHub
+5 -1
View File
@@ -88,7 +88,11 @@ func (nic *SInstancePort) InClassicNetwork() bool {
func (nic *SInstancePort) GetINetworkId() string {
for i := range nic.FixedIps {
if regutils.MatchIPAddr(nic.FixedIps[i].IpAddress) {
return nic.FixedIps[i].SubnetId
network, err := nic.region.GetNetwork(nic.FixedIps[i].SubnetId)
if err != nil {
return nic.FixedIps[i].SubnetId
}
return network.GetGlobalId()
}
}
return ""