本文整理汇总了Golang中launchpad/net/juju-core/state.Machine.EntityName方法的典型用法代码示例。如果您正苦于以下问题:Golang Machine.EntityName方法的具体用法?Golang Machine.EntityName怎么用?Golang Machine.EntityName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类launchpad/net/juju-core/state.Machine
的用法示例。
在下文中一共展示了Machine.EntityName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: checkStartInstance
// checkStartInstance checks that an instance has been started
// with a machine id the same as m's, and that the machine's
// instance id has been set appropriately.
func (s *ProvisionerSuite) checkStartInstance(c *C, m *state.Machine, secret string) {
s.State.StartSync()
for {
select {
case o := <-s.op:
switch o := o.(type) {
case dummy.OpStartInstance:
info := s.StateInfo(c)
info.EntityName = m.EntityName()
c.Assert(o.Info.Password, Not(HasLen), 0)
info.Password = o.Info.Password
c.Assert(o.Info, DeepEquals, info)
// Check we can connect to the state with
// the machine's entity name and password.
st, err := state.Open(o.Info)
c.Assert(err, IsNil)
st.Close()
c.Assert(o.MachineId, Equals, m.Id())
c.Assert(o.Instance, NotNil)
s.checkInstanceId(c, m, o.Instance)
c.Assert(o.Secret, Equals, secret)
return
default:
c.Logf("ignoring unexpected operation %#v", o)
}
case <-time.After(2 * time.Second):
c.Errorf("provisioner did not start an instance")
return
}
}
}