~juju/pyjuju/go

« back to all changes in this revision

Viewing changes to environs/tools.go

  • Committer: Roger Peppe
  • Date: 2012-05-25 16:54:37 UTC
  • mto: This revision was merged to the branch mainline in revision 184.
  • Revision ID: roger.peppe@canonical.com-20120525165437-emvrkzro0vlms2ld
environs/ec2: simplify putFakeTools by exporting ToolsPathForVersion from environs

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
var toolFilePat = regexp.MustCompile(`^` + toolPrefix + `(\d+\.\d+\.\d+)-([^-]+)-([^-]+)\.tgz$`)
33
33
 
34
 
// toolsPathForVersion returns a path for the juju tools with the
35
 
// given version, OS and architecture.
36
 
func toolsPathForVersion(v version.Version, series, arch string) string {
 
34
// ToolsPathForVersion returns the path that PutTools will use to
 
35
// store the juju tools with the given version, OS and architecture.
 
36
// It intended for testing purposes only.
 
37
func ToolsPathForVersion(v version.Version, series, arch string) string {
37
38
        return fmt.Sprintf(toolPrefix+"%v-%s-%s.tgz", v, series, arch)
38
39
}
39
40
 
40
41
// ToolsPath gives the path for the current juju tools, as expected
41
42
// by environs.Environ.PutFile, for example.
42
 
var toolsPath = toolsPathForVersion(version.Current, CurrentSeries, CurrentArch)
 
43
var toolsPath = ToolsPathForVersion(version.Current, CurrentSeries, CurrentArch)
43
44
 
44
45
// PutTools uploads the current version of the juju tools
45
46
// executables to the given storage.