cannot load service without specifying cf.libdir
See original GitHub issueOn FreeBSD, I’m running with this patch:
--- mqttwarn/core.py.orig 2020-08-07 20:15:24 UTC
+++ mqttwarn/core.py
@@ -531,7 +531,7 @@ def load_services(services):
modulefile = resource_filename('mqttwarn.services', module + '.py')
try:
- service_plugins[service]['module'] = load_module(modulefile)
+ service_plugins[service]['module'] = load_module(cf.libdir + '/' + modulefile)
logger.info('Successfully loaded service "{}"'.format(service))
except Exception as ex:
logger.exception('Unable to load service "{}" from file "{}": {}'.format(service, modulefile, ex))
FYI, on FreeBSD, core.py gets installed to:
$ pkg info -l py37-mqttwarn | grep core.py
/usr/local/lib/python3.7/site-packages/mqttwarn/core.py
and the libraries to:
[dan@mqtt01:/usr/local/etc/mqttwarn] $ pkg info -l py37-mqttwarn | grep pushover
/usr/local/lib/python3.7/site-packages/mqttwarn/services/__pycache__/pushover.cpython-37.opt-1.pyc
/usr/local/lib/python3.7/site-packages/mqttwarn/services/__pycache__/pushover.cpython-37.pyc
/usr/local/lib/python3.7/site-packages/mqttwarn/services/pushover.py
Does this make sense?
What is self.libdir
you might ask?
--- mqttwarn/configuration.py.orig 2020-08-07 20:14:30 UTC
+++ mqttwarn/configuration.py
@@ -45,6 +45,7 @@ class Config(RawConfigParser):
self.skipretained = False
self.cleansession = False
self.protocol = 3
+ self.libdir = ''
self.logformat = '%(asctime)-15s %(levelname)-8s [%(name)-25s] %(message)s'
self.logfile = None
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Upgrading PostgreSQL with broken PostGIS installation ...
The problem is apparently that the PostGIS releases are specific to a PostgreSQL database release as discussed here.
Read more >FAQ: Building Open MPI
If --with-<FOO> is specified with no optional directory, Open MPI's configure script will abort if it cannot find support for the FOO ...
Read more >Error: Cannot install in Homebrew on ARM processor in Intel ...
After this command : /usr/sbin/softwareupdate --install-rosetta --agree-to-license I get Installing Rosetta 2 on this system is not supported. – ...
Read more >Fedora Packaging Guidelines
Installing an application that depends on a library or service should not ... on a secondary architecture (such as an architecture-specific boot utility, ......
Read more >PHP Buildpack Configuration | Cloud Foundry Docs
The web server to use, such as HTTPD, Nginx, or no server. The PHP extensions that are enabled. The buildpack overrides the default ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On an unrelated note, because of the versions now in the FreeBSD ports tree, I’m running with this patch:
The original issue is not an issue any more. I can’t recall the origins now. The patch originated months ago and the cause is now lost.