This commit is contained in:
Vladimir Dombrovski 2023-07-13 11:37:31 +02:00 committed by GitHub
commit 5609fbd5a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -901,7 +901,7 @@ GLOBAL OPTIONS:
var hop string
if host.HopID != 0 {
var hopHost dbmodels.Host
if err := db.Model(host).Association("HopID").Find(&hopHost); err != nil {
if err := db.Model(host).Association("Hop").Find(&hopHost); err != nil {
return err
}
hop = hopHost.Name
@ -1028,7 +1028,7 @@ GLOBAL OPTIONS:
if c.Bool("unset-hop") {
var hopHost dbmodels.Host
if err := db.Model(&host).Association("HopID").Find(&hopHost); err != nil {
if err := db.Model(&host).Association("Hop").Find(&hopHost); err != nil {
return err
}
if err := model.Association("Hop").Clear(); err != nil {

View file

@ -144,7 +144,7 @@ func ChannelHandler(srv *ssh.Server, conn *gossh.ServerConn, newChan gossh.NewCh
}}, sessionConfigs...)
if currentHost.HopID != 0 {
var newHost dbmodels.Host
if err := actx.db.Model(currentHost).Association("HopID").Find(&newHost); err != nil {
if err := actx.db.Model(currentHost).Association("Hop").Find(&newHost); err != nil {
log.Printf("Error: %v", err)
return
}