本文整理汇总了Golang中github.com/juju/juju/environs.EnvironProvider.PrepareForBootstrap方法的典型用法代码示例。如果您正苦于以下问题:Golang EnvironProvider.PrepareForBootstrap方法的具体用法?Golang EnvironProvider.PrepareForBootstrap怎么用?Golang EnvironProvider.PrepareForBootstrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/environs.EnvironProvider
的用法示例。
在下文中一共展示了EnvironProvider.PrepareForBootstrap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: prepareForBootstrap
func prepareForBootstrap(
c *gc.C,
ctx environs.BootstrapContext,
provider environs.EnvironProvider,
sender *azuretesting.Senders,
attrs ...testing.Attrs,
) environs.Environ {
// Opening the environment should not incur network communication,
// so we don't set s.sender until after opening.
cfg := makeTestModelConfig(c, attrs...)
cfg, err := cfg.Remove([]string{"controller-resource-group"})
c.Assert(err, jc.ErrorIsNil)
*sender = azuretesting.Senders{tokenRefreshSender()}
cfg, err = provider.BootstrapConfig(environs.BootstrapConfigParams{
Config: cfg,
CloudRegion: "westus",
CloudEndpoint: "https://management.azure.com",
CloudStorageEndpoint: "https://core.windows.net",
Credentials: fakeUserPassCredential(),
})
c.Assert(err, jc.ErrorIsNil)
env, err := provider.PrepareForBootstrap(ctx, cfg)
c.Assert(err, jc.ErrorIsNil)
return env
}
示例2: prepareForBootstrap
func prepareForBootstrap(
c *gc.C,
ctx environs.BootstrapContext,
provider environs.EnvironProvider,
sender *azuretesting.Senders,
attrs ...testing.Attrs,
) environs.Environ {
// Opening the environment should not incur network communication,
// so we don't set s.sender until after opening.
cfg := makeTestModelConfig(c, attrs...)
cfg, err := cfg.Remove([]string{"controller-resource-group"})
c.Assert(err, jc.ErrorIsNil)
*sender = azuretesting.Senders{tokenRefreshSender()}
env, err := provider.PrepareForBootstrap(ctx, cfg)
c.Assert(err, jc.ErrorIsNil)
return env
}