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"