Skip to content

Commit f75f108

Browse files
committed
Rename EnvironConfig and a bunch of other environ related artifacts
1 parent ca623bc commit f75f108

File tree

353 files changed

+1808
-1848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+1808
-1848
lines changed

agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func (*suite) TestMigrate(c *gc.C) {
305305
Password: "secret",
306306
UpgradedToVersion: version.MustParse("1.16.5"),
307307
Jobs: []multiwatcher.MachineJob{
308-
multiwatcher.JobManageEnviron,
308+
multiwatcher.JobManageModel,
309309
multiwatcher.JobHostUnits,
310310
},
311311
CACert: "ca cert",

agent/bootstrap.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const BootstrapMachineId = "0"
5858
// state server, and initialize it. It also generates a new password for the
5959
// bootstrap machine and calls Write to save the the configuration.
6060
//
61-
// The envCfg values will be stored in the state's EnvironConfig; the
61+
// The envCfg values will be stored in the state's ModelConfig; the
6262
// machineCfg values will be used to configure the bootstrap Machine,
6363
// and its constraints will be also be used for the environment-level
6464
// constraints. The connection to the state server will respect the
@@ -222,8 +222,8 @@ func machineJobFromParams(job multiwatcher.MachineJob) (state.MachineJob, error)
222222
switch job {
223223
case multiwatcher.JobHostUnits:
224224
return state.JobHostUnits, nil
225-
case multiwatcher.JobManageEnviron:
226-
return state.JobManageEnviron, nil
225+
case multiwatcher.JobManageModel:
226+
return state.JobManageModel, nil
227227
case multiwatcher.JobManageNetworking:
228228
return state.JobManageNetworking, nil
229229
case multiwatcher.JobManageStateDeprecated:

agent/bootstrap_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ LXC_BRIDGE="ignored"`[1:])
123123
Addresses: initialAddrs,
124124
BootstrapConstraints: expectBootstrapConstraints,
125125
EnvironConstraints: expectEnvironConstraints,
126-
Jobs: []multiwatcher.MachineJob{multiwatcher.JobManageEnviron},
126+
Jobs: []multiwatcher.MachineJob{multiwatcher.JobManageModel},
127127
InstanceId: "i-bootstrap",
128128
Characteristics: expectHW,
129129
SharedSecret: "abc123",
@@ -168,7 +168,7 @@ LXC_BRIDGE="ignored"`[1:])
168168

169169
// Check that environment configuration has been added, and
170170
// environment constraints set.
171-
newEnvCfg, err := st.EnvironConfig()
171+
newEnvCfg, err := st.ModelConfig()
172172
c.Assert(err, jc.ErrorIsNil)
173173
c.Assert(newEnvCfg.AllAttrs(), gc.DeepEquals, envCfg.AllAttrs())
174174
gotEnvironConstraints, err := st.EnvironConstraints()
@@ -177,7 +177,7 @@ LXC_BRIDGE="ignored"`[1:])
177177

178178
// Check that the bootstrap machine looks correct.
179179
c.Assert(m.Id(), gc.Equals, "0")
180-
c.Assert(m.Jobs(), gc.DeepEquals, []state.MachineJob{state.JobManageEnviron})
180+
c.Assert(m.Jobs(), gc.DeepEquals, []state.MachineJob{state.JobManageModel})
181181
c.Assert(m.Series(), gc.Equals, series.HostSeries())
182182
c.Assert(m.CheckProvisioned(agent.BootstrapNonce), jc.IsTrue)
183183
c.Assert(m.Addresses(), jc.DeepEquals, filteredAddrs)
@@ -272,7 +272,7 @@ func (s *bootstrapSuite) TestInitializeStateFailsSecondTime(c *gc.C) {
272272
expectHW := instance.MustParseHardware("mem=2048M")
273273
mcfg := agent.BootstrapMachineConfig{
274274
BootstrapConstraints: constraints.MustParse("mem=1024M"),
275-
Jobs: []multiwatcher.MachineJob{multiwatcher.JobManageEnviron},
275+
Jobs: []multiwatcher.MachineJob{multiwatcher.JobManageModel},
276276
InstanceId: "i-bootstrap",
277277
Characteristics: expectHW,
278278
}
@@ -304,8 +304,8 @@ func (s *bootstrapSuite) TestMachineJobFromParams(c *gc.C) {
304304
name: multiwatcher.JobHostUnits,
305305
want: state.JobHostUnits,
306306
}, {
307-
name: multiwatcher.JobManageEnviron,
308-
want: state.JobManageEnviron,
307+
name: multiwatcher.JobManageModel,
308+
want: state.JobManageModel,
309309
}, {
310310
name: multiwatcher.JobManageNetworking,
311311
want: state.JobManageNetworking,

agent/format-1.18_whitebox_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (*format_1_18Suite) TestReadConfWithExisting1_18ConfigFileContents(c *gc.C)
7878
config, err := ReadConfig(configPath)
7979
c.Assert(err, jc.ErrorIsNil)
8080
c.Assert(config.UpgradedToVersion(), jc.DeepEquals, version.MustParse("1.17.5.1"))
81-
c.Assert(config.Jobs(), jc.DeepEquals, []multiwatcher.MachineJob{multiwatcher.JobManageEnviron})
81+
c.Assert(config.Jobs(), jc.DeepEquals, []multiwatcher.MachineJob{multiwatcher.JobManageModel})
8282
c.Assert(config.PreferIPv6(), jc.IsTrue)
8383
}
8484

@@ -89,7 +89,7 @@ datadir: /home/user/.juju/local
8989
logdir: /var/log/juju-user-local
9090
nonce: user-admin:bootstrap
9191
jobs:
92-
- JobManageEnviron
92+
- JobManageModel
9393
upgradedToVersion: 1.17.5.1
9494
cacert: '-----BEGIN CERTIFICATE-----
9595
@@ -238,7 +238,7 @@ datadir: /home/user/.juju/local
238238
logdir: /var/log/juju-user-local
239239
nonce: user-admin:bootstrap
240240
jobs:
241-
- JobManageEnviron
241+
- JobManageModel
242242
upgradedToVersion: 1.17.5.1
243243
cacert: '-----BEGIN CERTIFICATE-----
244244

api/addresser/addresser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewAPI(caller base.APICaller) *API {
3131
}
3232
}
3333

34-
// CanDeallocateAddresses checks if the current environment can
34+
// CanDeallocateAddresses checks if the current model can
3535
// deallocate IP addresses.
3636
func (api *API) CanDeallocateAddresses() (bool, error) {
3737
var result params.BoolResult

api/agent/machine_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type servingInfoSuite struct {
3535
var _ = gc.Suite(&servingInfoSuite{})
3636

3737
func (s *servingInfoSuite) TestStateServingInfo(c *gc.C) {
38-
st, _ := s.OpenAPIAsNewMachine(c, state.JobManageEnviron)
38+
st, _ := s.OpenAPIAsNewMachine(c, state.JobManageModel)
3939

4040
ssi := state.StateServingInfo{
4141
PrivateKey: "some key",
@@ -72,7 +72,7 @@ func (s *servingInfoSuite) TestIsMaster(c *gc.C) {
7272
}
7373
s.PatchValue(&apiserveragent.MongoIsMaster, fakeMongoIsMaster)
7474

75-
st, _ := s.OpenAPIAsNewMachine(c, state.JobManageEnviron)
75+
st, _ := s.OpenAPIAsNewMachine(c, state.JobManageModel)
7676
expected := true
7777
result, err := st.Agent().IsMaster()
7878

api/agent/state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (st *State) StateServingInfo() (params.StateServingInfo, error) {
5454
// agent lives at the same network address as the primary
5555
// mongo server for the replica set.
5656
// This call will return an error if the connected
57-
// agent is not a machine agent with environment-manager
57+
// agent is not a machine agent with model-manager
5858
// privileges.
5959
func (st *State) IsMaster() (bool, error) {
6060
var results params.IsMasterResult

api/allwatcher.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
// AllWatcher holds information allowing us to get Deltas describing
13-
// changes to the entire environment or all environments (depending on
13+
// changes to the entire model or all models (depending on
1414
// the watcher type).
1515
type AllWatcher struct {
1616
objType string
@@ -27,14 +27,14 @@ func NewAllWatcher(caller base.APICaller, id *string) *AllWatcher {
2727
return newAllWatcher("AllWatcher", caller, id)
2828
}
2929

30-
// NewAllEnvWatcher returns an AllWatcher instance which interacts
31-
// with a watcher created by the WatchAllEnvs API call.
30+
// NewAllModelWatcher returns an AllWatcher instance which interacts
31+
// with a watcher created by the WatchAllModels API call.
3232
//
3333
// There should be no need to call this from outside of the api
34-
// package. It is only used by Client.WatchAllEnvs in
34+
// package. It is only used by Client.WatchAllModels in
3535
// api/controller.
36-
func NewAllEnvWatcher(caller base.APICaller, id *string) *AllWatcher {
37-
return newAllWatcher("AllEnvWatcher", caller, id)
36+
func NewAllModelWatcher(caller base.APICaller, id *string) *AllWatcher {
37+
return newAllWatcher("AllModelWatcher", caller, id)
3838
}
3939

4040
func newAllWatcher(objType string, caller base.APICaller, id *string) *AllWatcher {
@@ -46,7 +46,7 @@ func newAllWatcher(objType string, caller base.APICaller, id *string) *AllWatche
4646
}
4747

4848
// Next returns a new set of deltas from a watcher previously created
49-
// by the WatchAll or WatchAllEnvs API calls. It will block until
49+
// by the WatchAll or WatchAllModels API calls. It will block until
5050
// there are deltas to return.
5151
func (watcher *AllWatcher) Next() ([]multiwatcher.Delta, error) {
5252
var info params.AllWatcherNextResults
@@ -61,7 +61,7 @@ func (watcher *AllWatcher) Next() ([]multiwatcher.Delta, error) {
6161
}
6262

6363
// Stop shutdowns down a watcher previously created by the WatchAll or
64-
// WatchAllEnvs API calls
64+
// WatchAllModels API calls
6565
func (watcher *AllWatcher) Stop() error {
6666
return watcher.caller.APICall(
6767
watcher.objType,

api/apiclient_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (s *apiclientSuite) TestOpenHonorsEnvironTag(c *gc.C) {
137137
st.Close()
138138

139139
// Backwards compatibility, we should succeed if we do not set an
140-
// environ tag
140+
// model tag
141141
info.ModelTag = names.NewModelTag("")
142142
st, err = api.Open(info, api.DialOpts{})
143143
c.Assert(err, jc.ErrorIsNil)

api/backups/base_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (s *baseSuite) checkMetadataResult(c *gc.C, result *params.BackupsMetadataR
5353
c.Check(result.Stored, gc.Equals, stored)
5454
c.Check(result.Notes, gc.Equals, meta.Notes)
5555

56-
c.Check(result.Environment, gc.Equals, meta.Origin.Environment)
56+
c.Check(result.Model, gc.Equals, meta.Origin.Model)
5757
c.Check(result.Machine, gc.Equals, meta.Origin.Machine)
5858
c.Check(result.Hostname, gc.Equals, meta.Origin.Hostname)
5959
c.Check(result.Version, gc.Equals, meta.Origin.Version)

api/backups/upload_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ func (s *uploadSuite) TestFailedRequest(c *gc.C) {
5656
meta := apiserverbackups.ResultFromMetadata(s.Meta)
5757
meta.ID = ""
5858
meta.Size = int64(len(data))
59-
// The Environment field is required, so zero it so that
59+
// The Model field is required, so zero it so that
6060
// we'll get an error from the endpoint.
61-
meta.Environment = ""
61+
meta.Model = ""
6262

6363
id, err := s.client.Upload(archive, meta)
6464
c.Assert(err, gc.ErrorMatches, `PUT https://.*/model/.*/backups: while storing backup archive: missing Model`)

api/base/caller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ type APICaller interface {
3535
// client can use with the current API server.
3636
BestFacadeVersion(facade string) int
3737

38-
// ModelTag returns the tag of the environment the client is
38+
// ModelTag returns the tag of the model the client is
3939
// connected to.
4040
ModelTag() (names.ModelTag, error)
4141

4242
// HTTPClient returns an httprequest.Client that can be used
4343
// to make HTTP requests to the API. URLs passed to the client
44-
// will be made relative to the API host and the current environment.
44+
// will be made relative to the API host and the current model.
4545
//
4646
// Note that the URLs in HTTP requests passed to the Client.Do
4747
// method should not include a host part.
@@ -54,7 +54,7 @@ type APICaller interface {
5454
type StreamConnector interface {
5555
// ConnectStream connects to the given HTTP websocket
5656
// endpoint path (interpreted relative to the receiver's
57-
// environment) and returns the resulting connection.
57+
// model) and returns the resulting connection.
5858
// The given parameters are used as URL query values
5959
// when making the initial HTTP request.
6060
//

api/block/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func NewClient(st base.APICallCloser) *Client {
2727
return &Client{ClientFacade: frontend, facade: backend}
2828
}
2929

30-
// List returns blocks that are switched on for current environment.
30+
// List returns blocks that are switched on for current model.
3131
func (c *Client) List() ([]params.Block, error) {
3232
blocks := params.BlockResults{}
3333
if err := c.facade.FacadeCall("List", nil, &blocks); err != nil {
@@ -46,7 +46,7 @@ func (c *Client) List() ([]params.Block, error) {
4646
return all, allErr.Combine()
4747
}
4848

49-
// SwitchBlockOn switches desired block on for the current environment.
49+
// SwitchBlockOn switches desired block on for the current model.
5050
// Valid block types are "BlockDestroy", "BlockRemove" and "BlockChange".
5151
func (c *Client) SwitchBlockOn(blockType, msg string) error {
5252
args := params.BlockSwitchParams{
@@ -63,7 +63,7 @@ func (c *Client) SwitchBlockOn(blockType, msg string) error {
6363
return nil
6464
}
6565

66-
// SwitchBlockOff switches desired block off for the current environment.
66+
// SwitchBlockOff switches desired block off for the current model.
6767
// Valid block types are "BlockDestroy", "BlockRemove" and "BlockChange".
6868
func (c *Client) SwitchBlockOff(blockType string) error {
6969
args := params.BlockSwitchParams{

api/charmrevisionupdater/updater_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (s *versionUpdaterSuite) SetUpTest(c *gc.C) {
3838
s.JujuConnSuite.SetUpTest(c)
3939
s.CharmSuite.SetUpTest(c)
4040

41-
machine, err := s.State.AddMachine("quantal", state.JobManageEnviron)
41+
machine, err := s.State.AddMachine("quantal", state.JobManageModel)
4242
c.Assert(err, jc.ErrorIsNil)
4343
password, err := utils.RandomPassword()
4444
c.Assert(err, jc.ErrorIsNil)

api/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ func (c *Client) UnshareModel(users ...names.UserTag) error {
429429
return result.Combine()
430430
}
431431

432-
// WatchAll holds the id of the newly-created AllWatcher/AllEnvWatcher.
432+
// WatchAll holds the id of the newly-created AllWatcher/AllModelWatcher.
433433
type WatchAll struct {
434434
AllWatcherId string
435435
}
@@ -456,7 +456,7 @@ func (c *Client) GetAnnotations(tag string) (map[string]string, error) {
456456

457457
// SetAnnotations sets the annotation pairs on the given entity.
458458
// Currently annotations are supported on machines, services,
459-
// units and the environment itself.
459+
// units and the model itself.
460460
// This API is now deprecated - "Annotations" client should be used instead.
461461
// TODO(anastasiamac) remove for Juju 2.x
462462
func (c *Client) SetAnnotations(tag string, pairs map[string]string) error {

api/client_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,15 @@ func (s *clientSuite) TestOpenUsesEnvironUUIDPaths(c *gc.C) {
493493
c.Assert(err, jc.ErrorIsNil)
494494
apistate.Close()
495495

496-
// Passing in the correct environment UUID should also work
496+
// Passing in the correct model UUID should also work
497497
environ, err := s.State.Model()
498498
c.Assert(err, jc.ErrorIsNil)
499499
info.ModelTag = environ.ModelTag()
500500
apistate, err = api.Open(info, api.DialOpts{})
501501
c.Assert(err, jc.ErrorIsNil)
502502
apistate.Close()
503503

504-
// Passing in a bad environment UUID should fail with a known error
504+
// Passing in a bad model UUID should fail with a known error
505505
info.ModelTag = names.NewModelTag("dead-beef-123456")
506506
apistate, err = api.Open(info, api.DialOpts{})
507507
c.Check(err, gc.ErrorMatches, `unknown model: "dead-beef-123456"`)
@@ -513,12 +513,12 @@ func (s *clientSuite) TestSetEnvironAgentVersionDuringUpgrade(c *gc.C) {
513513
// This is an integration test which ensure that a test with the
514514
// correct error code is seen by the client from the
515515
// SetModelAgentVersion call when an upgrade is in progress.
516-
envConfig, err := s.State.EnvironConfig()
516+
envConfig, err := s.State.ModelConfig()
517517
c.Assert(err, jc.ErrorIsNil)
518518
agentVersion, ok := envConfig.AgentVersion()
519519
c.Assert(ok, jc.IsTrue)
520520
machine := s.Factory.MakeMachine(c, &factory.MachineParams{
521-
Jobs: []state.MachineJob{state.JobManageEnviron},
521+
Jobs: []state.MachineJob{state.JobManageModel},
522522
})
523523
err = machine.SetAgentVersion(version.MustParseBinary(agentVersion.String() + "-quantal-amd64"))
524524
c.Assert(err, jc.ErrorIsNil)

api/common/apiaddresser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (a *APIAddresser) APIAddresses() ([]string, error) {
3838
return result.Result, nil
3939
}
4040

41-
// ModelUUID returns the model UUID to connect to the environment
41+
// ModelUUID returns the model UUID to connect to the model
4242
// that the current connection is for.
4343
func (a *APIAddresser) ModelUUID() (string, error) {
4444
var result params.StringResult

api/common/environwatcher.go

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)