mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 忽略 WebDAV 获取端口信息错误日志 (#3946)
This commit is contained in:
parent
ef5e42cf0b
commit
63484601b5
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
func loadParamFromVars(key string, vars map[string]interface{}) string {
|
func loadParamFromVars(key string, vars map[string]interface{}) string {
|
||||||
if _, ok := vars[key]; !ok {
|
if _, ok := vars[key]; !ok {
|
||||||
if key != "bucket" {
|
if key != "bucket" && key != "port" {
|
||||||
global.LOG.Errorf("load param %s from vars failed, err: not exist!", key)
|
global.LOG.Errorf("load param %s from vars failed, err: not exist!", key)
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/global"
|
||||||
"github.com/pkg/sftp"
|
"github.com/pkg/sftp"
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
)
|
)
|
||||||
@ -21,6 +22,9 @@ type sftpClient struct {
|
|||||||
func NewSftpClient(vars map[string]interface{}) (*sftpClient, error) {
|
func NewSftpClient(vars map[string]interface{}) (*sftpClient, error) {
|
||||||
address := loadParamFromVars("address", vars)
|
address := loadParamFromVars("address", vars)
|
||||||
port := loadParamFromVars("port", vars)
|
port := loadParamFromVars("port", vars)
|
||||||
|
if len(port) == 0 {
|
||||||
|
global.LOG.Errorf("load param port from vars failed, err: not exist!")
|
||||||
|
}
|
||||||
password := loadParamFromVars("password", vars)
|
password := loadParamFromVars("password", vars)
|
||||||
username := loadParamFromVars("username", vars)
|
username := loadParamFromVars("username", vars)
|
||||||
bucket := loadParamFromVars("bucket", vars)
|
bucket := loadParamFromVars("bucket", vars)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user