def ensure_server(self, status='ACTIVE'): try: server_id: str = self.stack.server_id nova.get_server(server_id=server_id) except heat.HeatStackNotFound: tobiko.setup_fixture(self.stack) except nova.ServerNotFoundError: tobiko.reset_fixture(self.stack) return self.stack.ensure_server_status(status=status)
def _test_reset_fixture(self, obj, should_clean=True): result = tobiko.reset_fixture(obj) self.assertIs(tobiko.get_fixture(obj), result) result.setup_fixture.assert_called_once_with() if should_clean: result.cleanup_fixture.assert_called_once_with() else: result.cleanup_fixture.assert_not_called()
def reconnect(self): return tobiko.reset_fixture(self)
def get_stack_parameters(self): return tobiko.reset_fixture(self.parameters).values