diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index e47ca73aac..9669b08e51 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -824,7 +824,7 @@ func (self *SHostManager) AllowGetPropertyBmStartRegisterScript(ctx context.Cont } func (self *SHostManager) GetPropertyBmStartRegisterScript(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error) { - regionUri, err := auth.GetServiceURL("compute_v2", options.Options.Region, "", "") + regionUri, err := auth.GetPublicServiceURL("compute_v2", options.Options.Region, "") if err != nil { return nil, err } diff --git a/pkg/mcclient/auth/auth.go b/pkg/mcclient/auth/auth.go index 7019b84401..08c8812a57 100644 --- a/pkg/mcclient/auth/auth.go +++ b/pkg/mcclient/auth/auth.go @@ -261,6 +261,10 @@ func GetServiceURL(service, region, zone, endpointType string) (string, error) { return manager.GetServiceURL(service, region, zone, endpointType) } +func GetPublicServiceURL(service, region, zone string) (string, error) { + return manager.GetServiceURL(service, region, zone, PublicEndpointType) +} + func GetServiceURLs(service, region, zone, endpointType string) ([]string, error) { return manager.GetServiceURLs(service, region, zone, endpointType) }