Skip to content

Commit

Permalink
Merge pull request #1052 from alesstimec/get-application-offer-consum…
Browse files Browse the repository at this point in the history
…e-details-fix-01

Fixes GetApplicationOfferConsumeDetails.
  • Loading branch information
alesstimec committed Oct 10, 2023
2 parents de480ca + 032a242 commit 951e107
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/jimm/applicationoffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (j *JIMM) GetApplicationOfferConsumeDetails(ctx context.Context, user *open
}
defer api.Close()

if err := api.GetApplicationOfferConsumeDetails(ctx, names.NewUserTag(user.Username), details, v); err != nil {
if err := api.GetApplicationOfferConsumeDetails(ctx, names.NewUserTag("admin"), details, v); err != nil {
return errors.E(op, err)
}

Expand Down
2 changes: 0 additions & 2 deletions internal/jujuapi/applicationoffers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ func (s *applicationOffersSuite) TestOffer(c *gc.C) {
}

func (s *applicationOffersSuite) TestGetConsumeDetails(c *gc.C) {
// NOTE (alesstimec): remove the skip once that is fixed in juju
c.Skip("JUJU_GET_CONSUME_DETAILS")
conn := s.open(c, nil, "bob@external")
defer conn.Close()
client := applicationoffers.NewClient(conn)
Expand Down
7 changes: 1 addition & 6 deletions internal/jujuclient/applicationoffers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,6 @@ func (s *applicationoffersSuite) TestDestroyApplicationOffer(c *gc.C) {
}

func (s *applicationoffersSuite) TestGetApplicationOfferConsumeDetails(c *gc.C) {
// NOTE (alesstimec): remove the skip once that is fixed in juju
c.Skip("JUJU_GET_CONSUME_DETAILS")
modelState, err := s.StatePool.Get(s.modelInfo.UUID)
c.Assert(err, gc.Equals, nil)
defer modelState.Release()
Expand Down Expand Up @@ -741,7 +739,7 @@ func (s *applicationoffersSuite) TestGetApplicationOfferConsumeDetails(c *gc.C)
info.Offer = &jujuparams.ApplicationOfferDetails{
OfferURL: offerURL.String(),
}
err = s.API.GetApplicationOfferConsumeDetails(ctx, names.NewUserTag("test-user@external"), &info, bakery.Version2)
err = s.API.GetApplicationOfferConsumeDetails(ctx, names.NewUserTag("admin"), &info, bakery.Version2)
c.Assert(err, gc.Equals, nil)
c.Check(info.Offer.OfferUUID, gc.Not(gc.Equals), "")
info.Offer.OfferUUID = ""
Expand Down Expand Up @@ -770,9 +768,6 @@ func (s *applicationoffersSuite) TestGetApplicationOfferConsumeDetails(c *gc.C)
UserName: auth.Everyone,
DisplayName: "",
Access: "read",
}, {
UserName: "test-user@external",
Access: "admin",
}},
},
ControllerInfo: &jujuparams.ExternalControllerInfo{
Expand Down

0 comments on commit 951e107

Please sign in to comment.