LEFT | RIGHT |
1 // The dummy provider implements an environment provider for testing | 1 // The dummy provider implements an environment provider for testing |
2 // purposes, registered with environs under the name "dummy". | 2 // purposes, registered with environs under the name "dummy". |
3 //· | 3 //· |
4 // The configuration YAML for the testing environment | 4 // The configuration YAML for the testing environment |
5 // must specify a "zookeeper" property with a boolean | 5 // must specify a "zookeeper" property with a boolean |
6 // value. If this is true, a zookeeper instance will be started | 6 // value. If this is true, a zookeeper instance will be started |
7 // the first time StateInfo is called on a newly reset environment. | 7 // the first time StateInfo is called on a newly reset environment. |
8 // NOTE: ZooKeeper isn't actually being started yet. | 8 // NOTE: ZooKeeper isn't actually being started yet. |
9 //· | 9 //· |
10 // The configuration data also accepts a "broken" property | 10 // The configuration data also accepts a "broken" property |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 func (e *environ) StateInfo() (*state.Info, error) { | 303 func (e *environ) StateInfo() (*state.Info, error) { |
304 if e.isBroken() { | 304 if e.isBroken() { |
305 return nil, errBroken | 305 return nil, errBroken |
306 } | 306 } |
307 if e.config.zookeeper && e.state.bootstrapped { | 307 if e.config.zookeeper && e.state.bootstrapped { |
308 return stateInfo(), nil | 308 return stateInfo(), nil |
309 } | 309 } |
310 return nil, errors.New("no state info available for this environ") | 310 return nil, errors.New("no state info available for this environ") |
311 } | 311 } |
312 | 312 |
313 func (e *environ) PlacementPolicy() state.PlacementPolicy { | 313 func (e *environ) AssignmentPolicy() state.AssignmentPolicy { |
314 » return state.PlaceUnassigned | 314 » return state.AssignUnused |
315 } | 315 } |
316 | 316 |
317 func (e *environ) SetConfig(cfg environs.EnvironConfig) { | 317 func (e *environ) SetConfig(cfg environs.EnvironConfig) { |
318 config := cfg.(*environConfig) | 318 config := cfg.(*environConfig) |
319 e.configMutex.Lock() | 319 e.configMutex.Lock() |
320 defer e.configMutex.Unlock() | 320 defer e.configMutex.Unlock() |
321 e.config = config | 321 e.config = config |
322 } | 322 } |
323 | 323 |
324 func (e *environ) Destroy([]environs.Instance) error { | 324 func (e *environ) Destroy([]environs.Instance) error { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 return m.id | 402 return m.id |
403 } | 403 } |
404 | 404 |
405 func (m *instance) DNSName() (string, error) { | 405 func (m *instance) DNSName() (string, error) { |
406 return m.id + ".dns", nil | 406 return m.id + ".dns", nil |
407 } | 407 } |
408 | 408 |
409 func (m *instance) WaitDNSName() (string, error) { | 409 func (m *instance) WaitDNSName() (string, error) { |
410 return m.DNSName() | 410 return m.DNSName() |
411 } | 411 } |
LEFT | RIGHT |