diff --git a/pkg/cloudcommon/options/options.go b/pkg/cloudcommon/options/options.go index a377a1cd9f0..0106001fb18 100644 --- a/pkg/cloudcommon/options/options.go +++ b/pkg/cloudcommon/options/options.go @@ -149,7 +149,8 @@ type HostCommonOptions struct { EnableRemoteExecutor bool `help:"Enable remote executor" default:"false"` - ExecutorConnectTimeoutSeconds int `help:"executor client connection timeout in seconds, default is 30" default:"30"` + ExecutorConnectTimeoutSeconds int `help:"executor client connection timeout in seconds, default is 30" default:"30"` + ImageDeployDriver string `help:"Image deploy driver" default:"qemu-kvm" choices:"qemu-kvm|nbd|libguestfs"` } type DBOptions struct { diff --git a/pkg/hostman/hostdeployer/deployserver/options.go b/pkg/hostman/hostdeployer/deployserver/options.go index 2683cdeccaf..b8043d75c7d 100644 --- a/pkg/hostman/hostdeployer/deployserver/options.go +++ b/pkg/hostman/hostdeployer/deployserver/options.go @@ -26,9 +26,8 @@ type SDeployOptions struct { PrivatePrefixes []string `help:"IPv4 private prefixes"` ChntpwPath string `help:"path to chntpw tool" default:"/usr/local/bin/chntpw.static"` - CloudrootDir string `help:"User cloudroot home dir" default:"/opt"` - ImageDeployDriver string `help:"Image deploy driver" default:"qemu-kvm" choices:"qemu-kvm|nbd|libguestfs"` - CommonConfigFile string `help:"common config file for container"` + CloudrootDir string `help:"User cloudroot home dir" default:"/opt"` + CommonConfigFile string `help:"common config file for container"` DeployTempDir string `help:"temp dir for deployer" default:"/opt/cloud/workspace/run/deploy"` diff --git a/pkg/hostman/hostinfo/hostinfo.go b/pkg/hostman/hostinfo/hostinfo.go index 973155f958c..e4c4a1b2129 100644 --- a/pkg/hostman/hostinfo/hostinfo.go +++ b/pkg/hostman/hostinfo/hostinfo.go @@ -2355,10 +2355,10 @@ func (h *SHostInfo) getNicsTelegrafConf() []map[string]interface{} { } func (h *SHostInfo) getHostname() string { - if len(h.FullName) > 0 { - return h.FullName + if h.FullName == "" { + h.FullName = h.fetchHostname() } - return h.fetchHostname() + return h.FullName } func (h *SHostInfo) GetCpuArchitecture() string {