Skip to content

Commit

Permalink
fix: host-deploy options struct consistent with host options (#19694)
Browse files Browse the repository at this point in the history
Co-authored-by: Qiu Jian <[email protected]>
  • Loading branch information
swordqiu and Qiu Jian authored Mar 12, 2024
1 parent a04eb0a commit 96ba0ba
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/hostman/hostdeployer/deployserver/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import (
"os"

common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
host_options "yunion.io/x/onecloud/pkg/hostman/options"
"yunion.io/x/onecloud/pkg/util/fileutils2"
)

type SDeployOptions struct {
common_options.HostCommonOptions
host_options.SHostBaseOptions

// PrivatePrefixes []string `help:"IPv4 private prefixes"`
ChntpwPath string `help:"path to chntpw tool" default:"/usr/local/bin/chntpw.static"`
Expand All @@ -33,9 +35,9 @@ type SDeployOptions struct {

AllowVmSELinux bool `help:"turn off vm selinux" default:"false" json:"allow_vm_selinux"`

HugepagesOption string `help:"Hugepages option: disable|native|transparent" default:"transparent"`
HugepageSizeMb int `help:"hugepage size mb default 1G" default:"1024"`
DefaultQemuVersion string `help:"Default qemu version" default:"4.2.0"`
HugepagesOption string `help:"Hugepages option: disable|native|transparent" default:"transparent"`
HugepageSizeMb int `help:"hugepage size mb default 1G" default:"1024"`
// DefaultQemuVersion string `help:"Default qemu version" default:"4.2.0"`
DeployGuestMemSizeMb int `help:"Deploy guest mem size mb" default:"320"`
ListenInterface string `help:"Master address of host server"`
Networks []string `help:"Network interface information"`
Expand All @@ -51,12 +53,12 @@ var DeployOption SDeployOptions
func Parse() SDeployOptions {
var hostOpts SDeployOptions
common_options.ParseOptions(&hostOpts, os.Args, "host.conf", "host")
if len(hostOpts.CommonConfigFile) > 0 {
commonCfg := &common_options.HostCommonOptions{}
if len(hostOpts.CommonConfigFile) > 0 && fileutils2.Exists(hostOpts.CommonConfigFile) {
commonCfg := &host_options.SHostBaseOptions{}
commonCfg.Config = hostOpts.CommonConfigFile
common_options.ParseOptions(commonCfg, []string{os.Args[0]}, "common.conf", "host")
baseOpt := hostOpts.BaseOptions.BaseOptions
hostOpts.HostCommonOptions = *commonCfg
hostOpts.SHostBaseOptions = *commonCfg
// keep base options
hostOpts.BaseOptions.BaseOptions = baseOpt
}
Expand Down

0 comments on commit 96ba0ba

Please sign in to comment.