本文整理汇总了Golang中github.com/juju/juju/state.Application.Refresh方法的典型用法代码示例。如果您正苦于以下问题:Golang Application.Refresh方法的具体用法?Golang Application.Refresh怎么用?Golang Application.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/state.Application
的用法示例。
在下文中一共展示了Application.Refresh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: assertUpgraded
func (s *BaseUpgradeCharmStateSuite) assertUpgraded(c *gc.C, riak *state.Application, revision int, forced bool) *charm.URL {
err := riak.Refresh()
c.Assert(err, jc.ErrorIsNil)
ch, force, err := riak.Charm()
c.Assert(err, jc.ErrorIsNil)
c.Assert(ch.Revision(), gc.Equals, revision)
c.Assert(force, gc.Equals, forced)
return ch.URL()
}
示例2: removeServiceAndUnits
func removeServiceAndUnits(c *gc.C, service *state.Application) {
// Destroy all units for the application.
units, err := service.AllUnits()
c.Assert(err, jc.ErrorIsNil)
for _, unit := range units {
err = unit.EnsureDead()
c.Assert(err, jc.ErrorIsNil)
err = unit.Remove()
c.Assert(err, jc.ErrorIsNil)
}
err = service.Destroy()
c.Assert(err, jc.ErrorIsNil)
err = service.Refresh()
c.Assert(err, jc.Satisfies, errors.IsNotFound)
}