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

Delta Between Two Patch Sets: environs/dummy/environs.go

Issue 6259062: add AssignmentPolicy to Environ
Left Patch Set: Created 12 years, 9 months ago
Right Patch Set: add AssignmentPolicy to Environ Created 12 years, 9 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 | « [revision details] ('k') | environs/ec2/ec2.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 // 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
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
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 }
LEFTRIGHT

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