当前位置: 首页>>代码示例>>Golang>>正文


Golang Machine.EnsureDead方法代码示例

本文整理汇总了Golang中github.com/juju/juju/state.Machine.EnsureDead方法的典型用法代码示例。如果您正苦于以下问题:Golang Machine.EnsureDead方法的具体用法?Golang Machine.EnsureDead怎么用?Golang Machine.EnsureDead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/juju/juju/state.Machine的用法示例。


在下文中一共展示了Machine.EnsureDead方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: createContainer

func (s *ContainerSetupSuite) createContainer(c *gc.C, host *state.Machine, ctype instance.ContainerType) {
	inst := s.checkStartInstanceNoSecureConnection(c, host)
	s.setupContainerWorker(c, host.Tag().(names.MachineTag))

	// make a container on the host machine
	template := state.MachineTemplate{
		Series: coretesting.FakeDefaultSeries,
		Jobs:   []state.MachineJob{state.JobHostUnits},
	}
	container, err := s.State.AddMachineInsideMachine(template, host.Id(), ctype)
	c.Assert(err, jc.ErrorIsNil)

	// the host machine agent should not attempt to create the container
	s.checkNoOperations(c)

	// cleanup
	c.Assert(container.EnsureDead(), gc.IsNil)
	c.Assert(container.Remove(), gc.IsNil)
	c.Assert(host.EnsureDead(), gc.IsNil)
	s.checkStopInstances(c, inst)
	s.waitRemoved(c, host)
}
开发者ID:chrisjohnston,项目名称:juju,代码行数:22,代码来源:container_initialisation_test.go

示例2: deadenMachine

func deadenMachine(c *gc.C, m *state.Machine) {
	c.Assert(m.EnsureDead(), jc.ErrorIsNil)
}
开发者ID:bac,项目名称:juju,代码行数:3,代码来源:machineremovals_test.go


注:本文中的github.com/juju/juju/state.Machine.EnsureDead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。