launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #15441
[Merge] lp:~rvb/juju-core/uploadtools into lp:~maas-maintainers/juju-core/maas-provider-skeleton
Raphaël Badin has proposed merging lp:~rvb/juju-core/uploadtools into lp:~maas-maintainers/juju-core/maas-provider-skeleton.
Commit message:
Cleanup the code related to uploading tools: this is now handled by juju itself rather than as the provider level.
Requested reviews:
MAAS Maintainers (maas-maintainers)
For more details, see:
https://code.launchpad.net/~rvb/juju-core/uploadtools/+merge/157610
Uploading the tools is now done using "juju sync-tools" (or (?) "juju bootstrap --upload-tools").
This was discussed with William Reade.
--
https://code.launchpad.net/~rvb/juju-core/uploadtools/+merge/157610
Your team MAAS Maintainers is requested to review the proposed merge of lp:~rvb/juju-core/uploadtools into lp:~maas-maintainers/juju-core/maas-provider-skeleton.
=== modified file 'environs/maas/environ.go'
--- environs/maas/environ.go 2013-04-05 10:38:15 +0000
+++ environs/maas/environ.go 2013-04-08 14:21:46 +0000
@@ -95,27 +95,12 @@
return nil
}
-// uploadTools builds the current version of the juju tools and uploads them
-// to the environment's Storage.
-func (env *maasEnviron) uploadTools() (*state.Tools, error) {
- tools, err := environs.PutTools(env.Storage(), nil)
- if err != nil {
- return nil, fmt.Errorf("cannot upload tools: %v", err)
- }
- return tools, nil
-}
-
-// findTools looks for a current version of the juju tools that is already
-// uploaded in the environment.
+// TODO: this code is cargo-culted from the openstack/ec2 providers.
func (env *maasEnviron) findTools() (*state.Tools, error) {
flags := environs.HighestVersion | environs.CompatVersion
v := version.Current
v.Series = env.Config().DefaultSeries()
- tools, err := environs.FindTools(env, v, flags)
- if err != nil {
- return nil, fmt.Errorf("cannot find tools: %v", err)
- }
- return tools, nil
+ return environs.FindTools(env, v, flags)
}
// getMongoURL returns the URL to the appropriate MongoDB instance.
@@ -184,8 +169,6 @@
// Bootstrap is specified in the Environ interface.
func (env *maasEnviron) Bootstrap(cons constraints.Value, stateServerCert, stateServerKey []byte) error {
- // TODO: Fix this quick hack. uploadTools is a now-obsolete parameter.
- uploadTools := false
// This was all cargo-culted from the EC2 provider.
password := env.Config().AdminSecret()
@@ -198,11 +181,7 @@
return err
}
var tools *state.Tools
- if uploadTools {
- tools, err = env.uploadTools()
- } else {
- tools, err = env.findTools()
- }
+ tools, err = env.findTools()
if err != nil {
return err
}