Skip to content

Commit f002f35

Browse files
committed
provider/manual: default enable-os-refresh-update to true
The manual provider should be doing "apt-get update" and installing packages by default. Fixes https://bugs.launchpad.net/juju-core/+bug/1363130
1 parent 8a61d29 commit f002f35

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

provider/manual/environ.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,6 @@ func (e *manualEnviron) Bootstrap(ctx environs.BootstrapContext, args environs.B
138138
if err := environs.FinishMachineConfig(mcfg, e.Config()); err != nil {
139139
return err
140140
}
141-
// If the tools are on the machine already, get a file:// scheme tools URL.
142-
// TODO(axw) this can go once environs/bootstrap.Bootstrap takes care of
143-
// serialising tools through cloudconfig/sshinit.
144-
storageDir := e.StorageDir()
145-
toolsStorageName := envtools.StorageName(mcfg.Tools.Version)
146-
bootstrapStorage := e.Storage()
147-
if url, _ := bootstrapStorage.URL(toolsStorageName); url == mcfg.Tools.URL {
148-
mcfg.Tools.URL = fmt.Sprintf("file://%s/%s", storageDir, toolsStorageName)
149-
}
150141
for k, v := range agentEnv {
151142
mcfg.AgentEnvironment[k] = v
152143
}

provider/manual/provider.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ func (p manualProvider) validate(cfg, old *config.Config) (*environConfig, error
144144
}
145145
}
146146

147-
// If the user hasn't specified a value, don't perform updates on
148-
// manual providers.
149-
defineIfNot("enable-os-refresh-update", false)
147+
// If the user hasn't specified a value, refresh the
148+
// available updates, but don't upgrade.
149+
defineIfNot("enable-os-refresh-update", true)
150150
defineIfNot("enable-os-upgrade", false)
151151

152152
return envConfig, nil

provider/manual/provider_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ func (s *providerSuite) TestDisablesUpdatesByDefault(c *gc.C) {
112112
validCfg, err := p.Validate(testConfig, nil)
113113
c.Assert(err, gc.IsNil)
114114

115-
// Unless specified, updates should default to false.
116-
c.Check(validCfg.EnableOSRefreshUpdate(), gc.Equals, false)
115+
// Unless specified, update should default to true,
116+
// upgrade to false.
117+
c.Check(validCfg.EnableOSRefreshUpdate(), gc.Equals, true)
117118
c.Check(validCfg.EnableOSUpgrade(), gc.Equals, false)
118119
}
119120

0 commit comments

Comments
 (0)