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

« back to all changes in this revision

Viewing changes to environs/manual/bootstrap.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:
10
10
        "launchpad.net/juju-core/environs"
11
11
        envtools "launchpad.net/juju-core/environs/tools"
12
12
        "launchpad.net/juju-core/instance"
13
 
        "launchpad.net/juju-core/names"
14
13
        "launchpad.net/juju-core/provider/common"
15
14
        "launchpad.net/juju-core/state"
16
15
        "launchpad.net/juju-core/tools"
30
29
        Host          string
31
30
        DataDir       string
32
31
        Environ       LocalStorageEnviron
33
 
        MachineId     string
34
32
        PossibleTools tools.List
35
33
}
36
34
 
51
49
        if args.DataDir == "" {
52
50
                return errors.New("data-dir argument is empty")
53
51
        }
54
 
        if !names.IsMachine(args.MachineId) {
55
 
                return errMachineIdInvalid(args.MachineId)
56
 
        }
57
52
 
58
53
        provisioned, err := checkProvisioned(args.Host)
59
54
        if err != nil {
118
113
                dataDir:       args.DataDir,
119
114
                environConfig: args.Environ.Config(),
120
115
                stateFileURL:  stateFileURL,
121
 
                machineId:     args.MachineId,
122
116
                bootstrap:     true,
123
117
                nonce:         state.BootstrapNonce,
124
118
                tools:         &tools,