diff --git a/libs/utils/energy.py b/libs/utils/energy.py index 9e78f45cff9789eae46b514b971f8f6963867598..302349da374fea1bea5f340c09bc57c875ce8cde 100644 --- a/libs/utils/energy.py +++ b/libs/utils/energy.py @@ -195,11 +195,11 @@ class HWMon(EnergyMeter): # Reformat data for output generation clusters_nrg = {} for channel in self._channels: - if channel not in nrg: + label = self._channels[channel] + if label not in nrg: raise RuntimeError('hwmon channel "{}" not available. ' 'Selected channels: {}'.format( channel, nrg.keys())) - label = self._channels[channel] nrg_total = nrg[label]['total'] self._log.debug('Energy [%16s]: %.6f', label, nrg_total) clusters_nrg[channel] = nrg_total