def check_state(self, context, phase): try: self.logger.info("\tChecking workload state...") screenshotPath = os.path.join(context.output_directory, "screen.png") self.device.capture_screen(screenshotPath) stateCheck = state_detector.verify_state(screenshotPath, self.statedefs_dir, phase) if not stateCheck: raise WorkloadError("Unexpected state after setup") except state_detector.StateDefinitionError as e: msg = "State definitions or template files missing or invalid ({}). Skipping state detection." self.logger.warning(msg.format(e.message))