Bug 252640 - net-mgmt/librenms: poller broken by patch
Summary: net-mgmt/librenms: poller broken by patch
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dan Langille
Depends on:
Reported: 2021-01-13 13:26 UTC by geoffroy desvernay
Modified: 2021-01-14 02:37 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (dvl)


Note You need to log in before you can comment on or make changes to this bug.
Description geoffroy desvernay 2021-01-13 13:26:06 UTC
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
Comment 1 Dan Langille freebsd_committer 2021-01-14 02:20:25 UTC
Oh, people are still using the poller wrapper? I thought that was deprecated in favor of librenms-service.py
Comment 2 Dan Langille freebsd_committer 2021-01-14 02:30:54 UTC
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
Comment 3 Dan Langille freebsd_committer 2021-01-14 02:37:14 UTC
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

Thank you.

[dan@pkg01:~/ports/head/net-mgmt/librenms] $ cat files/patch-poller-wrapper.py 
--- poller-wrapper.py.orig	2021-01-14 02:21:36 UTC
+++ poller-wrapper.py
@@ -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"