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

Side by Side Diff: juju/testing/conn.go

Issue 6852080: state: use string IDs for machines
Patch Set: state: use string IDs for machines Created 12 years, 4 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:
View unified diff | Download patch
« no previous file with comments | « environs/openstack/provider.go ('k') | state/assign_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package testing 1 package testing
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "io/ioutil" 5 "io/ioutil"
6 . "launchpad.net/gocheck" 6 . "launchpad.net/gocheck"
7 "launchpad.net/juju-core/charm" 7 "launchpad.net/juju-core/charm"
8 "launchpad.net/juju-core/environs" 8 "launchpad.net/juju-core/environs"
9 "launchpad.net/juju-core/environs/dummy" 9 "launchpad.net/juju-core/environs/dummy"
10 "launchpad.net/juju-core/juju" 10 "launchpad.net/juju-core/juju"
(...skipping 22 matching lines...) Expand all
33 testing.MgoSuite 33 testing.MgoSuite
34 Conn *juju.Conn 34 Conn *juju.Conn
35 State *state.State 35 State *state.State
36 RootDir string // The faked-up root directory. 36 RootDir string // The faked-up root directory.
37 oldHome string 37 oldHome string
38 } 38 }
39 39
40 // InvalidStateInfo holds information about no state - it will always 40 // InvalidStateInfo holds information about no state - it will always
41 // give an error when connected to. The machine id gives the machine id 41 // give an error when connected to. The machine id gives the machine id
42 // of the machine to be started 42 // of the machine to be started
43 func InvalidStateInfo(machineId int) *state.Info { 43 func InvalidStateInfo(machineId string) *state.Info {
44 return &state.Info{ 44 return &state.Info{
45 Addrs: []string{"0.1.2.3:1234"}, 45 Addrs: []string{"0.1.2.3:1234"},
46 EntityName: state.MachineEntityName(machineId), 46 EntityName: state.MachineEntityName(machineId),
47 Password: "unimportant", 47 Password: "unimportant",
48 CACert: []byte(testing.CACert), 48 CACert: []byte(testing.CACert),
49 } 49 }
50 } 50 }
51 51
52 const AdminSecret = "dummy-secret" 52 const AdminSecret = "dummy-secret"
53 53
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 func (s *JujuConnSuite) AddTestingCharm(c *C, name string) *state.Charm { 182 func (s *JujuConnSuite) AddTestingCharm(c *C, name string) *state.Charm {
183 ch := testing.Charms.Dir("series", name) 183 ch := testing.Charms.Dir("series", name)
184 ident := fmt.Sprintf("%s-%d", ch.Meta().Name, ch.Revision()) 184 ident := fmt.Sprintf("%s-%d", ch.Meta().Name, ch.Revision())
185 curl := charm.MustParseURL("local:series/" + ident) 185 curl := charm.MustParseURL("local:series/" + ident)
186 repo, err := charm.InferRepository(curl, testing.Charms.Path) 186 repo, err := charm.InferRepository(curl, testing.Charms.Path)
187 c.Assert(err, IsNil) 187 c.Assert(err, IsNil)
188 sch, err := s.Conn.PutCharm(curl, repo, false) 188 sch, err := s.Conn.PutCharm(curl, repo, false)
189 c.Assert(err, IsNil) 189 c.Assert(err, IsNil)
190 return sch 190 return sch
191 } 191 }
OLDNEW
« no previous file with comments | « environs/openstack/provider.go ('k') | state/assign_test.go » ('j') | no next file with comments »

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