Skip to content

Commit

Permalink
Atomic commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sayden committed Feb 21, 2019
1 parent b2ce8bc commit 60f10a6
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
"os"
"testing"

"github.com/pkg/errors"

"github.com/stretchr/testify/assert"

"github.com/elastic/beats/libbeat/common"
Expand Down Expand Up @@ -226,6 +228,9 @@ func createMLJob(host string, version *common.Version) error {
}

body, resp, err := httpPutJSON(host, jobURL, mlJob)
if err != nil {
return errors.Wrap(err, "error doing PUT request when creating ML job")
}

if resp.StatusCode != 200 {
return fmt.Errorf("HTTP error loading ml job %d: %s, %s", resp.StatusCode, resp.Status, string(body))
Expand All @@ -237,17 +242,17 @@ func createMLJob(host string, version *common.Version) error {
func createCCRStats(host string) error {
err := setupCCRRemote(host)
if err != nil {
return err
return errors.Wrap(err, "error setup CCR remote settings")
}

err = createCCRLeaderIndex(host)
if err != nil {
return err
return errors.Wrap(err, "error creating CCR leader index")
}

err = createCCRFollowerIndex(host)
if err != nil {
return err
return errors.Wrap(err, "error creating CCR follower index")
}

return nil
Expand Down

0 comments on commit 60f10a6

Please sign in to comment.