diff --git a/libs/utils/env.py b/libs/utils/env.py index f5bd768c3f7f33eee6bf5493b6d0b18cab5c7c1f..02b7334adc8cf521ede88294436d7ac881fa7f4b 100644 --- a/libs/utils/env.py +++ b/libs/utils/env.py @@ -677,18 +677,20 @@ class TestEnv(ShareState): return (self.platform, plt_file) def calibration(self, force=False): + """ + Get rt-app calibration. Run calibration on target if necessary. + + :param force: Always run calibration on target, even if we have not + installed rt-app or have already run calibration. + :returns: A dict with calibration results, which can be passed as the + ``calibration`` parameter to :class:`RTA`, or ``None`` if + force=False and we have not installed rt-app. + """ if not force and self._calib: return self._calib - required = False - if force: - required = True - if 'rt-app' in self.__tools: - required = True - elif 'wloads' in self.conf: - wloads = self.conf['wloads'].values() - required = any(['rt-app' in wl['type'] for wl in wloads]) + required = force or 'rt-app' in self.__installed_tools if not required: self._log.debug('No RT-App workloads, skipping calibration')