~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/provider/gce/provider.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        return env, errors.Trace(err)
24
24
}
25
25
 
26
 
// PrepareForBootstrap implements environs.EnvironProvider.
27
 
func (p environProvider) PrepareForBootstrap(ctx environs.BootstrapContext, args environs.PrepareForBootstrapParams) (environs.Environ, error) {
 
26
// BootstrapConfig implements environs.EnvironProvider.
 
27
func (p environProvider) BootstrapConfig(args environs.BootstrapConfigParams) (*config.Config, error) {
28
28
        // Add credentials to the configuration.
29
29
        cfg := args.Config
30
30
        switch authType := args.Credentials.AuthType(); authType {
51
51
        default:
52
52
                return nil, errors.NotSupportedf("%q auth-type", authType)
53
53
        }
 
54
        return p.PrepareForCreateEnvironment(cfg)
 
55
}
54
56
 
55
 
        cfg, err := p.PrepareForCreateEnvironment(cfg)
56
 
        if err != nil {
57
 
                return nil, errors.Trace(err)
58
 
        }
 
57
// PrepareForBootstrap implements environs.EnvironProvider.
 
58
func (p environProvider) PrepareForBootstrap(ctx environs.BootstrapContext, cfg *config.Config) (environs.Environ, error) {
59
59
        env, err := newEnviron(cfg)
60
60
        if err != nil {
61
61
                return nil, errors.Trace(err)
62
62
        }
63
 
 
64
63
        if ctx.ShouldVerifyCredentials() {
65
64
                if err := env.gce.VerifyCredentials(); err != nil {
66
65
                        return nil, errors.Trace(err)