the port's patch files/patch-poller-wrapper.py breaks poller-wrapper.py script (using os before importing it)
Traceback (most recent call last):
File "/usr/local/www/librenms/poller-wrapper.py", line 30, in <module>
os.environ['PATH'] += ':/usr/local/sbin:/usr/local/bin'
NameError: name 'os' is not defined
Just removing the patch fixes the port
Oh, people are still using the poller wrapper? I thought that was deprecated in favor of librenms-service.py
I see that I munged up this patch back with https://svnweb.freebsd.org/ports/head/net-mgmt/librenms/files/patch-poller-wrapper.py?r1=459372&r2=478715
Note the introduction of /usr/local
I am hesitant to remove the patch, but what about patching the patch?
How are things if you using this patch instead? By that, I mean move the os line down just above the APP_NAME
[dan@pkg01:~/ports/head/net-mgmt/librenms] $ cat files/patch-poller-wrapper.py
--- poller-wrapper.py.orig 2021-01-14 02:21:36 UTC
@@ -44,6 +44,8 @@ except ImportError as exc:
print('ERROR: %s' % exc)
+os.environ['PATH'] += ':/usr/local/sbin:/usr/local/bin'
APP_NAME = "poller_wrapper"
LOG_FILE = "logs/" + APP_NAME + ".log"
Is that new page working OK
I won't be able to test this before zone week... But as long as python doesn't break it's OK for me (if this line appears after 'import os').
Thank you and sorry for the delay !
And yes, I switched to using the service since, so no harm here :)
Were you able to test?
A commit references this bug:
Date: Mon Mar 29 14:41:31 UTC 2021
New revision: 569472
Update to 21.3.0
Upstream has changed their release number, but I don't think that will affect
us at all. It appears to follow year.month
I have sent some newly added patches upstream
(https://github.com/librenms/librenms/pull/12647) and they will be removed
from here on the next release.
This update jumps over 21.20, 21.1.0, & 17.0.1 for no reason.
While here, include a patch from an outstanding PR
Submitted by: geoffroy desvernay <firstname.lastname@example.org>
sorry for the delay… tested and approved here :)