修正:创建主机时只选择状态为 available 的网络

This commit is contained in:
Qiu Jian
2018-08-24 16:15:13 +08:00
parent c4692f0d5b
commit 58aecb256d
+1
View File
@@ -347,6 +347,7 @@ func (self *SWire) getNetworks() ([]SNetwork, error) {
func (self *SWire) getGatewayNetworkQuery() *sqlchemy.SQuery {
q := self.getNetworkQuery()
q = q.IsNotNull("guest_gateway").IsNotEmpty("guest_gateway")
q = q.Equals("status", NETWORK_STATUS_AVAILABLE)
return q
}