Merge pull request #4337 from wanyaoqi/bugfix/wyq/host-misc

fix endpoint type, chntpw path
This commit is contained in:
Zexi Li
2019-12-26 21:15:01 +08:00
committed by GitHub
2 changed files with 11 additions and 1 deletions
@@ -249,7 +249,13 @@ func (s *SDeployService) PrepareEnv() error {
}
if !winutils.CheckTool(DeployOption.ChntpwPath) {
log.Errorf("Failed to find chntpw tool")
if winutils.CheckTool("/usr/bin/chntpw.static") {
winutils.SetChntpwPath("/usr/bin/chntpw.static")
} else {
log.Errorf("Failed to find chntpw tool")
}
} else {
winutils.SetChntpwPath(DeployOption.ChntpwPath)
}
output, err = procutils.NewCommand("pvscan").Output()
+4
View File
@@ -44,6 +44,7 @@ import (
"yunion.io/x/onecloud/pkg/hostman/storageman"
"yunion.io/x/onecloud/pkg/hostman/system_service"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/util/cgrouputils"
"yunion.io/x/onecloud/pkg/util/fileutils2"
@@ -1364,6 +1365,9 @@ func (h *SHostInfo) unregister() {
func (h *SHostInfo) OnCatalogChanged(catalog mcclient.KeystoneServiceCatalogV3) {
// TODO: dynamic probe endpoint type
defaultEndpointType := options.HostOptions.SessionEndpointType
if len(defaultEndpointType) == 0 {
defaultEndpointType = auth.PublicEndpointType
}
if options.HostOptions.ManageNtpConfiguration {
ntpd := system_service.GetService("ntpd")
urls, _ := catalog.GetServiceURLs("ntp", options.HostOptions.Region, "", defaultEndpointType)