LEFT | RIGHT |
(no file at all) | |
1 package provisioner_test | 1 package provisioner_test |
2 | 2 |
3 import ( | 3 import ( |
4 "time" | 4 "time" |
5 | 5 |
6 . "launchpad.net/gocheck" | 6 . "launchpad.net/gocheck" |
7 "launchpad.net/juju-core/environs" | 7 "launchpad.net/juju-core/environs" |
8 "launchpad.net/juju-core/environs/dummy" | 8 "launchpad.net/juju-core/environs/dummy" |
9 "launchpad.net/juju-core/state" | 9 "launchpad.net/juju-core/state" |
10 "launchpad.net/juju-core/state/testing" | 10 "launchpad.net/juju-core/state/testing" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // that matches that of the given instance. If the instance is nil, | 155 // that matches that of the given instance. If the instance is nil, |
156 // It checks that the instance id is unset. | 156 // It checks that the instance id is unset. |
157 func (s *ProvisionerSuite) checkMachineId(c *C, m *state.Machine, inst environs.
Instance) { | 157 func (s *ProvisionerSuite) checkMachineId(c *C, m *state.Machine, inst environs.
Instance) { |
158 // TODO(dfc) add machine.WatchConfig() to avoid having to poll. | 158 // TODO(dfc) add machine.WatchConfig() to avoid having to poll. |
159 instId := "" | 159 instId := "" |
160 if inst != nil { | 160 if inst != nil { |
161 instId = inst.Id() | 161 instId = inst.Id() |
162 } | 162 } |
163 for a := veryShortAttempt.Start(); a.Next(); { | 163 for a := veryShortAttempt.Start(); a.Next(); { |
164 _, err := m.InstanceId() | 164 _, err := m.InstanceId() |
165 » » _, notset := err.(*state.NoInstanceIdError) | 165 » » _, notset := err.(*state.NotFoundError) |
166 if notset { | 166 if notset { |
167 if inst == nil { | 167 if inst == nil { |
168 return | 168 return |
169 } else { | 169 } else { |
170 continue | 170 continue |
171 } | 171 } |
172 } | 172 } |
173 c.Assert(err, IsNil) | 173 c.Assert(err, IsNil) |
174 break | 174 break |
175 } | 175 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 err = s.fixEnvironment() | 411 err = s.fixEnvironment() |
412 c.Assert(err, IsNil) | 412 c.Assert(err, IsNil) |
413 | 413 |
414 // create a third machine | 414 // create a third machine |
415 m, err = s.State.AddMachine() | 415 m, err = s.State.AddMachine() |
416 c.Assert(err, IsNil) | 416 c.Assert(err, IsNil) |
417 | 417 |
418 // the PA should create it using the new environment | 418 // the PA should create it using the new environment |
419 s.checkStartInstance(c, m) | 419 s.checkStartInstance(c, m) |
420 } | 420 } |
LEFT | RIGHT |