Skip to content

Conversation

@KanjiMonster
Copy link

Currently, both poed and poecli treat the absence of a platform file as an error. But non-PoE platforms do not have one, so this case is actually expected.

So change poed and poecli to treat this is meaning that there is no PoE support, and print a less alarming message, as well reduce its level to INFO for poed.

Instead of loudly complaining about failing to load the PoE platform due
to a missing file, treat the absence as no PoE support.

Reduces the log error:

> Sep 14 14:25:19 localhost systemd[1]: Started DentOS POE Agent.
> Sep 14 14:25:19 localhost poed.py[1008]: ALERT: Failed to load PoE platform. err: [Errno 2] No such file or directory: '/opt/poeagent/bin/../platforms/delta/tn48m-dn-r0/poe_platform.py'

To just:

> Sep 21 13:12:32 localhost systemd[1]: Started DentOS POE Agent.
> Sep 21 13:12:32 localhost poed.py[977]: INFO: No PoE platform found, assuming no PoE support.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
If there is no PoE platform file, assume this platform does not support
PoE instead of passing on the raw error message to the user.

Before:

> root@localhost:~# poecli
> Failed to load poe platform! ([Errno 2] No such file or directory: '/opt/poeagent/bin/../platforms/delta/tn48m-dn-r0/poe_platform.py')

After:

> root@localhost:~# poecli
> This platform does not support PoE.

Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
@KanjiMonster KanjiMonster force-pushed the jogo_complain_less_loudly branch from b7b9043 to 89d1dbc Compare September 27, 2023 14:04
@KanjiMonster KanjiMonster marked this pull request as ready for review September 27, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant