~themue/juju-core/053-env-more-script-friendly

« back to all changes in this revision

Viewing changes to cmd/juju/addunit.go

  • Committer: Dimiter Naydenov
  • Date: 2013-07-29 15:15:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1565.
  • Revision ID: dimiter.naydenov@canonical.com-20130729151541-zm8murwo9u7mtsdu
names: new package

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import (
7
7
        "errors"
8
8
        "fmt"
 
9
 
9
10
        "launchpad.net/gnuflag"
 
11
 
10
12
        "launchpad.net/juju-core/cmd"
11
13
        "launchpad.net/juju-core/juju"
12
 
        "launchpad.net/juju-core/state"
 
14
        "launchpad.net/juju-core/names"
13
15
        "launchpad.net/juju-core/state/api/params"
14
16
        "launchpad.net/juju-core/state/statecmd"
15
17
)
34
36
                if c.NumUnits > 1 {
35
37
                        return errors.New("cannot use --num-units > 1 with --to")
36
38
                }
37
 
                if !state.IsMachineOrNewContainer(c.ToMachineSpec) {
 
39
                if !names.IsMachineOrNewContainer(c.ToMachineSpec) {
38
40
                        return fmt.Errorf("invalid --to parameter %q", c.ToMachineSpec)
39
41
                }
40
42
        }