mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-25 10:16:12 +08:00
region: attachnetwork: allow attach by network name
isValidNetworkInfo allows names. Otherwise the code will panic when a named was passed and nil was returned by the fetch call
This commit is contained in:
@@ -59,7 +59,7 @@ func fetchGuestUsageFromSchedInfo(s *api.SchedInfo) (computemodels.SQuota, compu
|
||||
iNicCnt := 0
|
||||
|
||||
for _, netConfig := range s.Networks {
|
||||
if computemodels.IsExitNetworkInfo(netConfig) {
|
||||
if computemodels.IsExitNetworkInfo(s.UserCred, netConfig) {
|
||||
eNicCnt += 1
|
||||
} else {
|
||||
iNicCnt += 1
|
||||
|
||||
Reference in New Issue
Block a user