Skip to content

Commit 381ecf7

Browse files
committed
Merge branch '2.9' into juju-812-remove-connection-reboot-method
2 parents 72cf7c6 + 3754361 commit 381ecf7

File tree

8 files changed

+17
-22
lines changed

8 files changed

+17
-22
lines changed

api/interface.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"github.com/juju/version/v2"
2020
"gopkg.in/macaroon.v2"
2121

22-
"github.com/juju/juju/api/agent/unitassigner"
2322
"github.com/juju/juju/api/base"
2423
"github.com/juju/juju/core/network"
2524
"github.com/juju/juju/proxy"
@@ -322,11 +321,10 @@ type Connection interface {
322321
// associated with.
323322
CookieURL() *url.URL
324323

325-
// These methods expose a bunch of worker-specific facades, and basically
324+
// This methods expose a bunch of worker-specific facades, and basically
326325
// just should not exist; but removing them is too noisy for a single CL.
327326
// Client in particular is intimately coupled with State -- and the others
328327
// will be easy to remove, but until we're using them via manifolds it's
329328
// prohibitively ugly to do so.
330329
Client() *Client
331-
UnitAssigner() unitassigner.API
332330
}

api/state.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"gopkg.in/macaroon.v2"
2121

2222
"github.com/juju/juju/api/agent/keyupdater"
23-
"github.com/juju/juju/api/agent/unitassigner"
2423
"github.com/juju/juju/api/base"
2524
"github.com/juju/juju/core/network"
2625
"github.com/juju/juju/feature"
@@ -310,12 +309,6 @@ func (st *state) Client() *Client {
310309
return &Client{ClientFacade: frontend, facade: backend, st: st}
311310
}
312311

313-
// UnitAssigner returns a version of the state that provides functionality
314-
// required by the unitassigner worker.
315-
func (st *state) UnitAssigner() unitassigner.API {
316-
return unitassigner.New(st)
317-
}
318-
319312
// KeyUpdater returns access to the KeyUpdater API
320313
func (st *state) KeyUpdater() *keyupdater.State {
321314
return keyupdater.NewState(st)

apiserver/facades/client/application/application_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/juju/utils/v3"
2222
gc "gopkg.in/check.v1"
2323

24+
unitassignerapi "github.com/juju/juju/api/agent/unitassigner"
2425
"github.com/juju/juju/apiserver/common"
2526
commontesting "github.com/juju/juju/apiserver/common/testing"
2627
"github.com/juju/juju/apiserver/facades/client/application"
@@ -1044,7 +1045,7 @@ func (s *applicationSuite) TestApplicationSetCharm(c *gc.C) {
10441045
URL: curl.String(),
10451046
}, s.openRepo)
10461047
c.Assert(err, jc.ErrorIsNil)
1047-
errs, err := s.APIState.UnitAssigner().AssignUnits([]names.UnitTag{
1048+
errs, err := unitassignerapi.New(s.APIState).AssignUnits([]names.UnitTag{
10481049
names.NewUnitTag("application/0"),
10491050
names.NewUnitTag("application/1"),
10501051
names.NewUnitTag("application/2"),
@@ -1087,7 +1088,7 @@ func (s *applicationSuite) setupApplicationSetCharm(c *gc.C) {
10871088
c.Assert(err, jc.ErrorIsNil)
10881089
c.Assert(results.Results, gc.HasLen, 1)
10891090
c.Assert(results.Results[0].Error, gc.IsNil)
1090-
errs, err := s.APIState.UnitAssigner().AssignUnits([]names.UnitTag{
1091+
errs, err := unitassignerapi.New(s.APIState).AssignUnits([]names.UnitTag{
10911092
names.NewUnitTag("application/0"),
10921093
names.NewUnitTag("application/1"),
10931094
names.NewUnitTag("application/2"),
@@ -1168,7 +1169,7 @@ func (s *applicationSuite) TestApplicationSetCharmForceUnits(c *gc.C) {
11681169
URL: curl.String(),
11691170
}, s.openRepo)
11701171
c.Assert(err, jc.ErrorIsNil)
1171-
errs, err := s.APIState.UnitAssigner().AssignUnits([]names.UnitTag{
1172+
errs, err := unitassignerapi.New(s.APIState).AssignUnits([]names.UnitTag{
11721173
names.NewUnitTag("application/0"),
11731174
names.NewUnitTag("application/1"),
11741175
names.NewUnitTag("application/2"),
@@ -1558,7 +1559,7 @@ func (s *applicationSuite) TestApplicationDeployToMachine(c *gc.C) {
15581559
c.Assert(charm.Meta(), gc.DeepEquals, ch.Meta())
15591560
c.Assert(charm.Config(), gc.DeepEquals, ch.Config())
15601561

1561-
errs, err := s.APIState.UnitAssigner().AssignUnits([]names.UnitTag{names.NewUnitTag("application-name/0")})
1562+
errs, err := unitassignerapi.New(s.APIState).AssignUnits([]names.UnitTag{names.NewUnitTag("application-name/0")})
15621563
c.Assert(errs, gc.DeepEquals, []error{nil})
15631564
c.Assert(err, jc.ErrorIsNil)
15641565

@@ -1616,7 +1617,7 @@ func (s *applicationSuite) TestApplicationDeployToMachineWithLXDProfile(c *gc.C)
16161617
Devices: expectedProfile.Devices,
16171618
})
16181619

1619-
errs, err := s.APIState.UnitAssigner().AssignUnits([]names.UnitTag{names.NewUnitTag("application-name/0")})
1620+
errs, err := unitassignerapi.New(s.APIState).AssignUnits([]names.UnitTag{names.NewUnitTag("application-name/0")})
16201621
c.Assert(errs, gc.DeepEquals, []error{nil})
16211622
c.Assert(err, jc.ErrorIsNil)
16221623

@@ -1683,7 +1684,7 @@ func (s *applicationSuite) TestApplicationDeployToMachineWithInvalidLXDProfileAn
16831684
Devices: expectedProfile.Devices,
16841685
})
16851686

1686-
errs, err := s.APIState.UnitAssigner().AssignUnits([]names.UnitTag{names.NewUnitTag("application-name/0")})
1687+
errs, err := unitassignerapi.New(s.APIState).AssignUnits([]names.UnitTag{names.NewUnitTag("application-name/0")})
16871688
c.Assert(errs, gc.DeepEquals, []error{nil})
16881689
c.Assert(err, jc.ErrorIsNil)
16891690

cmd/containeragent/initialize/package_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ func (*importSuite) TestImports(c *gc.C) {
3838
"api/common",
3939
"api/common/cloudspec",
4040
"api/agent/keyupdater",
41-
"api/agent/unitassigner",
4241
"api/watcher",
4342
"apiserver/errors",
4443
"rpc/params",

cmd/juju/application/deploy_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"gopkg.in/macaroon.v2"
3939

4040
"github.com/juju/juju/api"
41+
unitassignerapi "github.com/juju/juju/api/agent/unitassigner"
4142
"github.com/juju/juju/api/base"
4243
"github.com/juju/juju/api/client/annotations"
4344
"github.com/juju/juju/api/client/application"
@@ -1223,7 +1224,7 @@ func (s *DeploySuite) TestPlacement(c *gc.C) {
12231224
c.Assert(err, jc.ErrorIsNil)
12241225

12251226
// manually run staged assignments
1226-
errs, err := s.APIState.UnitAssigner().AssignUnits([]names.UnitTag{names.NewUnitTag("dummy/0")})
1227+
errs, err := unitassignerapi.New(s.APIState).AssignUnits([]names.UnitTag{names.NewUnitTag("dummy/0")})
12271228
c.Assert(errs, gc.DeepEquals, []error{nil})
12281229
c.Assert(err, jc.ErrorIsNil)
12291230

@@ -1273,7 +1274,7 @@ func (s *DeploySuite) assertForceMachine(c *gc.C, machineId string) {
12731274
c.Assert(err, jc.ErrorIsNil)
12741275

12751276
// manually run staged assignments
1276-
errs, err := s.APIState.UnitAssigner().AssignUnits([]names.UnitTag{names.NewUnitTag("portlandia/0")})
1277+
errs, err := unitassignerapi.New(s.APIState).AssignUnits([]names.UnitTag{names.NewUnitTag("portlandia/0")})
12771278
c.Assert(errs, gc.DeepEquals, []error{nil})
12781279
c.Assert(err, jc.ErrorIsNil)
12791280

cmd/juju/application/refresh_resources_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"gopkg.in/macaroon.v2"
2323

2424
"github.com/juju/juju/api"
25+
unitassignerapi "github.com/juju/juju/api/agent/unitassigner"
2526
"github.com/juju/juju/api/base"
2627
"github.com/juju/juju/api/client/resources/client"
2728
apicommoncharms "github.com/juju/juju/api/common/charms"
@@ -163,7 +164,7 @@ Deploying charm "cs:bionic/starsay-1".`
163164
unit, err := s.State.Unit("starsay/0")
164165
c.Assert(err, jc.ErrorIsNil)
165166
tags := []names.UnitTag{unit.UnitTag()}
166-
errs, err := s.APIState.UnitAssigner().AssignUnits(tags)
167+
errs, err := unitassignerapi.New(s.APIState).AssignUnits(tags)
167168
c.Assert(err, jc.ErrorIsNil)
168169
c.Assert(errs, gc.DeepEquals, []error{nil})
169170

cmd/juju/application/refresh_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"gopkg.in/macaroon.v2"
3030

3131
"github.com/juju/juju/api"
32+
"github.com/juju/juju/api/agent/unitassigner"
3233
"github.com/juju/juju/api/base"
3334
"github.com/juju/juju/api/client/application"
3435
"github.com/juju/juju/api/client/resources/client"
@@ -712,7 +713,7 @@ func (s *RefreshSuccessStateSuite) TestForcedSeriesUpgrade(c *gc.C) {
712713
c.Assert(units, gc.HasLen, 1)
713714
unit := units[0]
714715
tags := []names.UnitTag{unit.UnitTag()}
715-
errs, err := s.APIState.UnitAssigner().AssignUnits(tags)
716+
errs, err := unitassigner.New(s.APIState).AssignUnits(tags)
716717
c.Assert(err, jc.ErrorIsNil)
717718
c.Assert(errs, gc.DeepEquals, make([]error, len(units)))
718719

juju/testing/repo.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/juju/utils/v3"
1313
gc "gopkg.in/check.v1"
1414

15+
unitassignerapi "github.com/juju/juju/api/agent/unitassigner"
1516
"github.com/juju/juju/state"
1617
"github.com/juju/juju/state/storage"
1718
"github.com/juju/juju/version"
@@ -72,7 +73,7 @@ func (s *RepoSuite) AssertUnitMachines(c *gc.C, units []*state.Unit) {
7273

7374
// manually assign all units to machines. This replaces work normally done
7475
// by the unitassigner code.
75-
errs, err := s.APIState.UnitAssigner().AssignUnits(tags)
76+
errs, err := unitassignerapi.New(s.APIState).AssignUnits(tags)
7677
c.Assert(err, jc.ErrorIsNil)
7778
c.Assert(errs, gc.DeepEquals, make([]error, len(units)))
7879

0 commit comments

Comments
 (0)