Exemplo n.º 1
0
func (s *MigrationSuite) TestIsMigrationActive(c *gc.C) {
	check := func(expected bool) {
		isActive, err := s.State2.IsMigrationActive()
		c.Assert(err, jc.ErrorIsNil)
		c.Check(isActive, gc.Equals, expected)

		isActive2, err := state.IsMigrationActive(s.State, s.State2.ModelUUID())
		c.Assert(err, jc.ErrorIsNil)
		c.Check(isActive2, gc.Equals, expected)
	}

	check(false)

	_, err := s.State2.CreateMigration(s.stdSpec)
	c.Assert(err, jc.ErrorIsNil)

	check(true)
}
Exemplo n.º 2
0
// IsMigrationActive implements PrecheckBackend.
func (s *precheckShim) IsMigrationActive(modelUUID string) (bool, error) {
	return state.IsMigrationActive(s.State, modelUUID)
}