fix endpoint type, chntpw path

This commit is contained in:
wanyaoqi
2019-12-26 16:50:09 +08:00
parent b601feb8fa
commit 6b2058dcee
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"
@@ -1353,6 +1354,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)