mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
hostnetworks: GetHostNetworkByAddress(): fix logic invert
This commit is contained in:
@@ -92,7 +92,7 @@ func (man *SHostnetworkManager) QueryByAddress(addr string) *sqlchemy.SQuery {
|
||||
func (man *SHostnetworkManager) GetHostNetworkByAddress(addr string) *SHostnetwork {
|
||||
network := SHostnetwork{}
|
||||
err := man.QueryByAddress(addr).First(&network)
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
return &network
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user