~rogpeppe/juju-core/438-local-instance-Addresses

« back to all changes in this revision

Viewing changes to environs/cloudinit.go

  • Committer: Tarmac
  • Author(s): William Reade
  • Date: 2013-10-02 10:38:04 UTC
  • mfrom: (1915.1.3 juju-core)
  • Revision ID: tarmac-20131002103804-zxlnv7ik17unxc3p
[r=fwereade] provider/common: Destroy, and tests

Added a common implementation of Destroy, and tests for Bootstrap which had
somehow never been written. Also drive-by removed the machineId arg from
consideration when bootstrapping, because, WTF... a non-0 bootstrap machine
would break *everything*.

https://codereview.appspot.com/14254043/

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
// bootstrap node.  You'll still need to supply more information, but this
43
43
// takes care of the fixed entries and the ones that are always needed.
44
44
// stateInfoURL is the storage URL for the environment's state file.
45
 
func NewBootstrapMachineConfig(machineID, stateInfoURL string) *cloudinit.MachineConfig {
 
45
func NewBootstrapMachineConfig(stateInfoURL string) *cloudinit.MachineConfig {
46
46
        // For a bootstrap instance, FinishMachineConfig will provide the
47
 
        // state.Info and the api.Info.
48
 
        mcfg := NewMachineConfig(machineID, state.BootstrapNonce, nil, nil)
 
47
        // state.Info and the api.Info. The machine id must *always* be "0".
 
48
        mcfg := NewMachineConfig("0", state.BootstrapNonce, nil, nil)
49
49
        mcfg.StateServer = true
50
50
        mcfg.StateInfoURL = stateInfoURL
51
51
        return mcfg