Skip to content

Commit

Permalink
fix: add check of pusher type and error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauric Desauw committed Oct 14, 2021
1 parent 846781d commit 2b0505f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion smartwatts/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,18 @@ def term_handler(_, __):
pushers_info = pusher_generator.generate(args)
pushers_formula = {}
pushers_power = {}


for pusher_name in pushers_info:
pusher_cls, pusher_start_message = pushers_info[pusher_name]
print(pusher_start_message.database.report_type)


if pusher_start_message.database.report_type == PowerReport:
pushers_power[pusher_name] = supervisor.launch(pusher_cls, pusher_start_message)
elif pusher_start_message.database.report_type == FormulaReport:
pushers_formula[pusher_name] = supervisor.launch(pusher_cls, pusher_start_message)
else:
raise InitializationException("Pusher parameters : Provide supported report typ as model for pusher")

logging.info('CPU formula is %s' % ('DISABLED' if fconf['disable-cpu-formula'] else 'ENABLED'))
if not fconf['disable-cpu-formula']:
Expand Down

0 comments on commit 2b0505f

Please sign in to comment.