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

« back to all changes in this revision

Viewing changes to cmd/jujud/upgradevalidation.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:
14
14
        "launchpad.net/juju-core/container/lxc"
15
15
        "launchpad.net/juju-core/environs/provider"
16
16
        "launchpad.net/juju-core/instance"
 
17
        "launchpad.net/juju-core/names"
17
18
        "launchpad.net/juju-core/state"
18
19
        "launchpad.net/juju-core/state/api"
19
20
        "launchpad.net/juju-core/utils"
60
61
        //     package for exactly the same reasons.
61
62
        // Later, post-precise LTS, when we have updated lxc, we can bring this
62
63
        // back in to have nested lxc, but until then, we have to avoid it.
63
 
        containerType := state.ContainerTypeFromId(state.MachineIdFromTag(machineTag))
 
64
        id, err := names.MachineIdFromTag(machineTag)
 
65
        if err != nil {
 
66
                return err
 
67
        }
 
68
        containerType := state.ContainerTypeFromId(id)
64
69
        providerType := os.Getenv("JUJU_PROVIDER_TYPE")
65
70
        if providerType == provider.Local || containerType == instance.LXC {
66
71
                return nil