1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-03 03:42:35 +01:00

Adding instrument_is_enabled function

As instrumentation can be enabled/disabled for a specfic workload
execution, it is sometimes not enough to verify that an instrument has
been installed for the run; one might need to check whether it is
currently enabled.
This commit is contained in:
Sergei Trofimov
2015-05-28 10:13:50 +01:00
parent a254a44f0e
commit 777003ed51
3 changed files with 31 additions and 1 deletions

View File

@@ -197,6 +197,18 @@ def is_installed(instrument):
return False
def is_enabled(instrument):
if isinstance(instrument, Instrument) or isinstance(instrument, type):
name = instrument.name
else: # assume string
name = instrument
try:
installed_instrument = get_instrument(name)
return installed_instrument.is_enabled
except ValueError:
return False
failures_detected = False