mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #14139 from ioito/hotfix/qx-openstack-nic
fix(region): openstack vm nic
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user