fix: remove apiversion param from session

This commit is contained in:
QIU Jian
2022-08-25 09:43:50 +08:00
committed by Qiu Jian
parent c6f557fd68
commit 293afd2e69
165 changed files with 381 additions and 487 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ func (agent *SBaremetalAgent) GetZoneId() string {
}
func (agent *SBaremetalAgent) GetAdminSession() *mcclient.ClientSession {
return auth.GetAdminSession(context.TODO(), o.Options.Region, "v2")
return auth.GetAdminSession(context.TODO(), o.Options.Region)
}
func (agent *SBaremetalAgent) GetListenIP() (net.IP, error) {
+3 -3
View File
@@ -138,7 +138,7 @@ func eventToJson(e redfish.SEvent) *jsonutils.JSONDict {
func fetchLogs(baremetal *SBaremetalInstance, ctx context.Context, logType string) error {
params := jsonutils.NewDict()
s := auth.GetAdminSession(ctx, consts.GetRegion(), "")
s := auth.GetAdminSession(ctx, consts.GetRegion())
params.Add(jsonutils.NewInt(1), "limit")
params.Add(jsonutils.NewString(baremetal.GetId()), "host_id")
params.Add(jsonutils.NewString(logType), "type")
@@ -216,8 +216,8 @@ func (job *SSendMetricsJob) Name() string {
}
func (job *SSendMetricsJob) Do(ctx context.Context, now time.Time) error {
s := auth.GetAdminSession(ctx, consts.GetRegion(), "")
urls, err := s.GetServiceURLs("influxdb", o.Options.SessionEndpointType)
s := auth.GetAdminSession(ctx, consts.GetRegion())
urls, err := s.GetServiceURLs("influxdb", o.Options.SessionEndpointType, "")
if err != nil {
return errors.Wrap(err, "s.GetServiceURLs")
}
+1 -1
View File
@@ -78,7 +78,7 @@ func NewBaremetalRegisterTask(
}
func (s *sBaremetalRegisterTask) getSession() *mcclient.ClientSession {
return auth.GetSession(context.Background(), s.userCred, o.Options.Region, "v2")
return auth.GetSession(context.Background(), s.userCred, o.Options.Region)
}
func (s *sBaremetalRegisterTask) getAccessDevMacAddr(ip string) (string, error) {