From a29e8f99fe19e3262b234f0224a9f2aa0374fe96 Mon Sep 17 00:00:00 2001 From: Michael Mraka Date: Tue, 10 Sep 2024 13:40:05 +0200 Subject: [PATCH] RHINENG-9505: DEBUG --- base/api/client.go | 1 + manager/controllers/template_systems_update.go | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/base/api/client.go b/base/api/client.go index 6bab2de53..5aeb3d470 100644 --- a/base/api/client.go +++ b/base/api/client.go @@ -44,6 +44,7 @@ func (o *Client) Request(ctx *context.Context, method, url string, return httpResp, errors.Wrap(err, "Response body reading failed") } + utils.LogDebug("bodyBytes", bodyBytes, "client.Request()") if len(bodyBytes) > 0 { err = json.Unmarshal(bodyBytes, responseOutPtr) if err != nil { diff --git a/manager/controllers/template_systems_update.go b/manager/controllers/template_systems_update.go index 25e0d7b47..d90d6bca6 100644 --- a/manager/controllers/template_systems_update.go +++ b/manager/controllers/template_systems_update.go @@ -69,6 +69,7 @@ func TemplateSystemsUpdateHandler(c *gin.Context) { if err != nil { return } + utils.LogDebug("TemplateSystemsUpdateHandler env assigned") // re-evaluate systems added/removed from templates if config.EnableTemplateChangeEval { @@ -172,16 +173,18 @@ func templateArchVersionMatch( func callCandlepin(ctx context.Context, consumer string, request *candlepin.ConsumersUpdateRequest) ( *candlepin.ConsumersUpdateResponse, error) { candlepinEnvConsumersURL := utils.CoreCfg.CandlepinAddress + "/consumers/" + consumer + utils.LogDebug("candlepinEnvConsumersURL ", candlepinEnvConsumersURL) candlepinFunc := func() (interface{}, *http.Response, error) { - utils.LogTrace("request", *request, "candlepin /consumers request") + utils.LogDebug("request", *request, "candlepin /consumers request") candlepinResp := candlepin.ConsumersUpdateResponse{} resp, err := candlepinClient.Request(&ctx, http.MethodPut, candlepinEnvConsumersURL, request, &candlepinResp) + utils.LogDebug("resp", resp.Body, "err", err, "candlepinClient.Request()") statusCode := utils.TryGetStatusCode(resp) utils.LogDebug("status_code", statusCode, "candlepin /consumers call") - utils.LogTrace("response", resp, "candlepin /consumers response") if err != nil && statusCode == 400 { err = errors.Wrap(errCandlepin, err.Error()) } + utils.LogDebug("return callCandlepin") return &candlepinResp, resp, err } @@ -225,6 +228,7 @@ func assignCandlepinEnvironment(db *gorm.DB, accountID int, env *string, invento err = errors2.Join(err, apiErr, errors.New(resp.Message)) } } + utils.LogDebug("return assignCandlepinEnvironment") return err }