Skip to content

Commit

Permalink
remove code that got moved to github.com/juju/version and move everyt…
Browse files Browse the repository at this point in the history
…hing to use that package, as well as rename juju/juju/version to jujuversion
  • Loading branch information
natefinch committed Nov 13, 2015
1 parent a09030e commit e0f7d22
Show file tree
Hide file tree
Showing 182 changed files with 694 additions and 1,190 deletions.
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
"github.com/juju/utils"
"github.com/juju/utils/series"
"github.com/juju/utils/shell"
"github.com/juju/version"

"github.com/juju/juju/api"
"github.com/juju/juju/apiserver/params"
"github.com/juju/juju/juju/paths"
"github.com/juju/juju/mongo"
"github.com/juju/juju/network"
"github.com/juju/juju/state/multiwatcher"
"github.com/juju/juju/version"
)

var logger = loggo.GetLogger("juju.agent")
Expand Down
45 changes: 23 additions & 22 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ import (

"github.com/juju/names"
jc "github.com/juju/testing/checkers"
"github.com/juju/version"
gc "gopkg.in/check.v1"

"github.com/juju/juju/agent"
"github.com/juju/juju/api"
"github.com/juju/juju/apiserver/params"
"github.com/juju/juju/jujuversion"
"github.com/juju/juju/mongo"
"github.com/juju/juju/network"
"github.com/juju/juju/state/multiwatcher"
"github.com/juju/juju/testing"
"github.com/juju/juju/version"
)

type suite struct {
Expand Down Expand Up @@ -55,15 +56,15 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
},
checkErr: "password not found in configuration",
}, {
about: "missing environment tag",
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
},
checkErr: "environment not found in configuration",
Expand All @@ -72,7 +73,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
Environment: names.NewEnvironTag("uuid"),
},
Expand All @@ -82,7 +83,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
Environment: testing.EnvironmentTag,
},
Expand All @@ -92,7 +93,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
CACert: "ca cert",
Environment: testing.EnvironmentTag,
Expand All @@ -103,7 +104,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
CACert: "ca cert",
Environment: testing.EnvironmentTag,
Expand All @@ -115,7 +116,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
CACert: "ca cert",
Environment: testing.EnvironmentTag,
Expand All @@ -127,7 +128,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
CACert: "ca cert",
Environment: testing.EnvironmentTag,
Expand All @@ -138,7 +139,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
CACert: "ca cert",
Environment: testing.EnvironmentTag,
Expand All @@ -149,7 +150,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
CACert: "ca cert",
Environment: testing.EnvironmentTag,
Expand All @@ -162,7 +163,7 @@ var agentConfigTests = []struct {
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
Password: "sekrit",
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
CACert: "ca cert",
Environment: testing.EnvironmentTag,
StateAddresses: []string{"localhost:1234"},
Expand All @@ -175,7 +176,7 @@ var agentConfigTests = []struct {
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
Password: "sekrit",
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
CACert: "ca cert",
Environment: testing.EnvironmentTag,
StateAddresses: []string{"localhost:1234"},
Expand All @@ -191,7 +192,7 @@ var agentConfigTests = []struct {
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
Password: "sekrit",
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
CACert: "ca cert",
Environment: testing.EnvironmentTag,
StateAddresses: []string{"localhost:1234"},
Expand All @@ -210,7 +211,7 @@ var agentConfigTests = []struct {
},
Tag: names.NewMachineTag("1"),
Password: "sekrit",
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
CACert: "ca cert",
Environment: testing.EnvironmentTag,
StateAddresses: []string{"localhost:1234"},
Expand All @@ -225,7 +226,7 @@ var agentConfigTests = []struct {
params: agent.AgentConfigParams{
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewUserTag("admin"), // this is a joke, the admin user is nil.
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
},
checkErr: "entity tag must be MachineTag or UnitTag, got names.UserTag",
Expand All @@ -235,7 +236,7 @@ var agentConfigTests = []struct {
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewUnitTag("ubuntu/1"),
Password: "sekrit",
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Environment: testing.EnvironmentTag,
CACert: "ca cert",
StateAddresses: []string{"localhost:1234"},
Expand All @@ -250,7 +251,7 @@ var agentConfigTests = []struct {
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
Password: "sekrit",
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
CACert: "ca cert",
Environment: testing.EnvironmentTag,
StateAddresses: []string{"localhost:1234"},
Expand All @@ -267,7 +268,7 @@ var agentConfigTests = []struct {
Paths: agent.Paths{DataDir: "/data/dir"},
Tag: names.NewMachineTag("1"),
Password: "sekrit",
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
CACert: "ca cert",
Environment: testing.EnvironmentTag,
StateAddresses: []string{"localhost:1234"},
Expand Down Expand Up @@ -506,7 +507,7 @@ var attributeParams = agent.AgentConfigParams{
DataDir: "/data/dir",
},
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
CACert: "ca cert",
StateAddresses: []string{"localhost:1234"},
Expand All @@ -525,7 +526,7 @@ func (*suite) TestAttributes(c *gc.C) {
c.Assert(conf.Tag(), gc.Equals, names.NewMachineTag("1"))
c.Assert(conf.Dir(), gc.Equals, "/data/dir/agents/machine-1")
c.Assert(conf.Nonce(), gc.Equals, "a nonce")
c.Assert(conf.UpgradedToVersion(), jc.DeepEquals, version.Current)
c.Assert(conf.UpgradedToVersion(), jc.DeepEquals, jujuversion.Current)
}

func (*suite) TestStateServingInfo(c *gc.C) {
Expand Down Expand Up @@ -723,7 +724,7 @@ func (*suite) TestSetUpgradedToVersion(c *gc.C) {
conf, err := agent.NewAgentConfig(attributeParams)
c.Assert(err, jc.ErrorIsNil)

c.Assert(conf.UpgradedToVersion(), gc.Equals, version.Current)
c.Assert(conf.UpgradedToVersion(), gc.Equals, jujuversion.Current)

expectVers := version.MustParse("3.4.5")
conf.SetUpgradedToVersion(expectVers)
Expand Down
12 changes: 6 additions & 6 deletions agent/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
"github.com/juju/juju/environs"
"github.com/juju/juju/environs/config"
"github.com/juju/juju/instance"
"github.com/juju/juju/jujuversion"
"github.com/juju/juju/mongo"
"github.com/juju/juju/network"
"github.com/juju/juju/provider/dummy"
"github.com/juju/juju/state"
"github.com/juju/juju/state/multiwatcher"
"github.com/juju/juju/testing"
"github.com/juju/juju/version"
)

type bootstrapSuite struct {
Expand Down Expand Up @@ -89,7 +89,7 @@ LXC_BRIDGE="ignored"`[1:])
configParams := agent.AgentConfigParams{
Paths: agent.Paths{DataDir: dataDir},
Tag: names.NewMachineTag("0"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
StateAddresses: []string{s.mgoInst.Addr()},
CACert: testing.CACert,
Password: pwHash,
Expand Down Expand Up @@ -136,7 +136,7 @@ LXC_BRIDGE="ignored"`[1:])
filteredAddrs = append([]network.Address{}, initialAddrs...)
}
envAttrs := dummy.SampleConfig().Delete("admin-secret").Merge(testing.Attrs{
"agent-version": version.Current.String(),
"agent-version": jujuversion.Current.String(),
"state-id": "1", // needed so policy can Open config
})
envCfg, err := config.New(config.NoDefaults, envAttrs)
Expand Down Expand Up @@ -222,7 +222,7 @@ func (s *bootstrapSuite) TestInitializeStateWithStateServingInfoNotAvailable(c *
configParams := agent.AgentConfigParams{
Paths: agent.Paths{DataDir: c.MkDir()},
Tag: names.NewMachineTag("0"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
StateAddresses: []string{s.mgoInst.Addr()},
CACert: testing.CACert,
Password: "fake",
Expand All @@ -247,7 +247,7 @@ func (s *bootstrapSuite) TestInitializeStateFailsSecondTime(c *gc.C) {
configParams := agent.AgentConfigParams{
Paths: agent.Paths{DataDir: dataDir},
Tag: names.NewMachineTag("0"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
StateAddresses: []string{s.mgoInst.Addr()},
CACert: testing.CACert,
Password: pwHash,
Expand All @@ -272,7 +272,7 @@ func (s *bootstrapSuite) TestInitializeStateFailsSecondTime(c *gc.C) {
Characteristics: expectHW,
}
envAttrs := dummy.SampleConfig().Delete("admin-secret").Merge(testing.Attrs{
"agent-version": version.Current.String(),
"agent-version": jujuversion.Current.String(),
"state-id": "1", // needed so policy can Open config
})
envCfg, err := config.New(config.NoDefaults, envAttrs)
Expand Down
2 changes: 1 addition & 1 deletion agent/format-1.16.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"strconv"

"github.com/juju/names"
"github.com/juju/version"
goyaml "gopkg.in/yaml.v2"

"github.com/juju/juju/apiserver/params"
"github.com/juju/juju/version"
)

var format_1_16 = formatter_1_16{}
Expand Down
2 changes: 1 addition & 1 deletion agent/format-1.16_whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
jc "github.com/juju/testing/checkers"
"github.com/juju/utils"
"github.com/juju/utils/series"
"github.com/juju/version"
gc "gopkg.in/check.v1"

"github.com/juju/juju/juju/paths"
"github.com/juju/juju/testing"
"github.com/juju/juju/version"
)

type format_1_16Suite struct {
Expand Down
2 changes: 1 addition & 1 deletion agent/format-1.18.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (

"github.com/juju/errors"
"github.com/juju/names"
"github.com/juju/version"
goyaml "gopkg.in/yaml.v2"

"github.com/juju/juju/apiserver/params"
"github.com/juju/juju/state/multiwatcher"
"github.com/juju/juju/version"
)

var format_1_18 = formatter_1_18{}
Expand Down
2 changes: 1 addition & 1 deletion agent/format-1.18_whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
jc "github.com/juju/testing/checkers"
"github.com/juju/utils"
"github.com/juju/utils/series"
"github.com/juju/version"
gc "gopkg.in/check.v1"

"github.com/juju/juju/juju/paths"
"github.com/juju/juju/state/multiwatcher"
"github.com/juju/juju/testing"
"github.com/juju/juju/version"
)

type format_1_18Suite struct {
Expand Down
4 changes: 2 additions & 2 deletions agent/format_whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (

"github.com/juju/juju/apiserver/params"
"github.com/juju/juju/cloudconfig/cloudinit"
"github.com/juju/juju/jujuversion"
"github.com/juju/juju/state/multiwatcher"
"github.com/juju/juju/testing"
"github.com/juju/juju/version"
)

type formatSuite struct {
Expand All @@ -30,7 +30,7 @@ var _ = gc.Suite(&formatSuite{})
// located here for easy reuse.
var agentParams = AgentConfigParams{
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Jobs: []multiwatcher.MachineJob{multiwatcher.JobHostUnits},
Password: "sekrit",
CACert: "ca cert",
Expand Down
4 changes: 2 additions & 2 deletions agent/identity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
gc "gopkg.in/check.v1"

"github.com/juju/juju/apiserver/params"
"github.com/juju/juju/jujuversion"
"github.com/juju/juju/testing"
"github.com/juju/juju/version"
)

type identitySuite struct {
Expand All @@ -28,7 +28,7 @@ var _ = gc.Suite(&identitySuite{})

var attributeParams = AgentConfigParams{
Tag: names.NewMachineTag("1"),
UpgradedToVersion: version.Current,
UpgradedToVersion: jujuversion.Current,
Password: "sekrit",
CACert: "ca cert",
StateAddresses: []string{"localhost:1234"},
Expand Down
3 changes: 2 additions & 1 deletion agent/tools/diskmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ package tools
import (
"io"

"github.com/juju/version"

"github.com/juju/juju/tools"
"github.com/juju/juju/version"
)

// DiskManager keeps track of a collections of Juju agent tools in a directory
Expand Down
2 changes: 1 addition & 1 deletion agent/tools/diskmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"path/filepath"

jc "github.com/juju/testing/checkers"
"github.com/juju/version"
gc "gopkg.in/check.v1"

agenttools "github.com/juju/juju/agent/tools"
coretesting "github.com/juju/juju/testing"
coretools "github.com/juju/juju/tools"
"github.com/juju/juju/version"
)

var _ = gc.Suite(&DiskManagerSuite{})
Expand Down
Loading

0 comments on commit e0f7d22

Please sign in to comment.