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

Delta Between Two Patch Sets: cmd/jujud/util_test.go

Issue 6501106: environs: remove VarDir global
Left Patch Set: Created 11 years, 6 months ago
Right Patch Set: environs: remove VarDir global Created 11 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « cmd/jujud/upgrade_test.go ('k') | container/container.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 package main 1 package main
2 2
3 import ( 3 import (
4 "io/ioutil" 4 "io/ioutil"
5 "launchpad.net/gnuflag" 5 "launchpad.net/gnuflag"
6 . "launchpad.net/gocheck" 6 . "launchpad.net/gocheck"
7 "launchpad.net/juju-core/cmd" 7 "launchpad.net/juju-core/cmd"
8 ) 8 )
9 9
10 type acCreator func() (cmd.Command, *AgentConf) 10 type acCreator func() (cmd.Command, *AgentConf)
(...skipping 10 matching lines...) Expand all
21 // are necessary to allow parsing to succeed (specified in args). 21 // are necessary to allow parsing to succeed (specified in args).
22 func CheckAgentCommand(c *C, create acCreator, args []string) cmd.Command { 22 func CheckAgentCommand(c *C, create acCreator, args []string) cmd.Command {
23 com, _ := create() 23 com, _ := create()
24 err := initCmd(com, args) 24 err := initCmd(com, args)
25 c.Assert(err, ErrorMatches, "--zookeeper-servers option must be set") 25 c.Assert(err, ErrorMatches, "--zookeeper-servers option must be set")
26 args = append(args, "--zookeeper-servers", "zk1:2181,zk2:2181") 26 args = append(args, "--zookeeper-servers", "zk1:2181,zk2:2181")
27 27
28 com, conf := create() 28 com, conf := create()
29 c.Assert(initCmd(com, args), IsNil) 29 c.Assert(initCmd(com, args), IsNil)
30 c.Assert(conf.StateInfo.Addrs, DeepEquals, []string{"zk1:2181", "zk2:218 1"}) 30 c.Assert(conf.StateInfo.Addrs, DeepEquals, []string{"zk1:2181", "zk2:218 1"})
31 » c.Assert(conf.VarDir, Equals, "/var/lib/juju") 31 » c.Assert(conf.DataDir, Equals, "/var/lib/juju")
32 » args = append(args, "--juju-directory", "jd") 32 » args = append(args, "--data-dir", "jd")
33 33
34 com, conf = create() 34 com, conf = create()
35 c.Assert(initCmd(com, args), IsNil) 35 c.Assert(initCmd(com, args), IsNil)
36 c.Assert(conf.StateInfo.Addrs, DeepEquals, []string{"zk1:2181", "zk2:218 1"}) 36 c.Assert(conf.StateInfo.Addrs, DeepEquals, []string{"zk1:2181", "zk2:218 1"})
37 » c.Assert(conf.VarDir, Equals, "jd") 37 » c.Assert(conf.DataDir, Equals, "jd")
38 return com 38 return com
39 } 39 }
40 40
41 // ParseAgentCommand is a utility function that inserts the always-required args 41 // ParseAgentCommand is a utility function that inserts the always-required args
42 // before parsing an agent command and returning the result. 42 // before parsing an agent command and returning the result.
43 func ParseAgentCommand(ac cmd.Command, args []string) error { 43 func ParseAgentCommand(ac cmd.Command, args []string) error {
44 common := []string{ 44 common := []string{
45 "--zookeeper-servers", "zk:2181", 45 "--zookeeper-servers", "zk:2181",
46 » » "--juju-directory", "jd", 46 » » "--data-dir", "jd",
47 } 47 }
48 return initCmd(ac, append(common, args...)) 48 return initCmd(ac, append(common, args...))
49 } 49 }
LEFTRIGHT

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