---
matahari.spec.in | 1 +
src/python/matahari/rpc_server.py | 7 +++++--
src/rpc/CMakeLists.txt | 1 +
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/matahari.spec.in b/matahari.spec.in
index 81ce81e..827c9e4 100644
--- a/matahari.spec.in
+++ b/matahari.spec.in
@@ -581,6 +581,7 @@ test "x%{buildroot}" != "x" && rm -rf
%{buildroot}
%files rpc
%defattr(644, root, root, 755)
%doc AUTHORS COPYING
+%attr(0755, -, -) %dir /usr/lib/matahari/plugins
%if %{systemd}
%{_unitdir}/matahari-rpc.service
diff --git a/src/python/matahari/rpc_server.py b/src/python/matahari/rpc_server.py
index 6cf2eea..eddcd4c 100644
--- a/src/python/matahari/rpc_server.py
+++ b/src/python/matahari/rpc_server.py
@@ -2,7 +2,7 @@ import sys, os
import json
import traceback
-(PLUGIN_PATH,) = ('.',) # TODO: choose proper install path
+(PLUGIN_PATH,) = ('/usr/lib/matahari/plugins',)
class Plugin(object):
def __init__(self, module):
@@ -28,7 +28,10 @@ def plugins(path=PLUGIN_PATH):
old_path = sys.path
try:
sys.path = [path] + old_path
- filenames = [os.path.splitext(f) for f in os.listdir(path)]
+ try:
+ filenames = [os.path.splitext(f) for f in os.listdir(path)]
+ except OSError:
+ return []
modnames = [n for n, e in filenames if e == '.py']
def getPlugin(name):
try:
diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt
index a43be57..a6794c3 100644
--- a/src/rpc/CMakeLists.txt
+++ b/src/rpc/CMakeLists.txt
@@ -16,5 +16,6 @@ if(WITH-QMF)
install(TARGETS ${QMF_AGENT} DESTINATION sbin)
+ install(CODE "file(MAKE_DIRECTORY
\$ENV{DESTDIR}/usr/lib/matahari/plugins)")
endif(WITH-QMF)
Show replies by date