Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Unified Diff: cmd/juju/upgradejuju.go

Issue 8545043: environs: extract tools package
Patch Set: environs: extract tools package Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cmd/juju/synctools_test.go ('k') | cmd/juju/upgradejuju_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmd/juju/upgradejuju.go
=== modified file 'cmd/juju/upgradejuju.go'
--- cmd/juju/upgradejuju.go 2013-02-28 02:55:21 +0000
+++ cmd/juju/upgradejuju.go 2013-04-08 22:25:49 +0000
@@ -6,6 +6,7 @@
"launchpad.net/juju-core/cmd"
"launchpad.net/juju-core/environs"
"launchpad.net/juju-core/environs/config"
+ "launchpad.net/juju-core/environs/tools"
"launchpad.net/juju-core/juju"
"launchpad.net/juju-core/state"
"launchpad.net/juju-core/version"
@@ -24,7 +25,7 @@
vers string
}
-var putTools = environs.PutTools
+var uploadTools = tools.Upload
func (c *UpgradeJujuCommand) Info() *cmd.Info {
return &cmd.Info{
@@ -78,15 +79,13 @@
if c.BumpVersion {
vers := c.bumpedVersion()
forceVersion = &vers.Number
- c.Version = vers.Number
}
- tools, err := putTools(c.conn.Environ.Storage(), forceVersion)
+ tools, err := uploadTools(c.conn.Environ.Storage(), forceVersion)
if err != nil {
return err
}
- c.toolsList.Private = append(c.toolsList.Private, tools)
- }
- if c.Version == (version.Number{}) {
+ c.Version = tools.Number
+ } else if c.Version == (version.Number{}) {
c.Version, err = c.newestVersion()
if err != nil {
return fmt.Errorf("cannot find newest version: %v", err)
« no previous file with comments | « cmd/juju/synctools_test.go ('k') | cmd/juju/upgradejuju_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b