Skip to content

Commit

Permalink
RHINENG-9505: DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka committed Sep 11, 2024
1 parent e447264 commit f7ded35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions manager/controllers/template_systems_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -172,16 +173,19 @@ 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")
candlepinResp := candlepin.ConsumersUpdateResponse{}
resp, err := candlepinClient.Request(&ctx, http.MethodPut, candlepinEnvConsumersURL, request, &candlepinResp)
utils.LogDebug("resp", resp, "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
}

Expand Down Expand Up @@ -225,6 +229,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
}

0 comments on commit f7ded35

Please sign in to comment.