From 12a311319227347e648dcc3ecff4f095e62fb4d4 Mon Sep 17 00:00:00 2001 From: Hemna Date: Tue, 9 Jan 2024 01:30:43 +0000 Subject: [PATCH] Force fortune path during setup test For whatever reason shutil.which() can't find fortune in the path, unless you specify the entire path. --- aprsd/plugins/fortune.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aprsd/plugins/fortune.py b/aprsd/plugins/fortune.py index bd952b8..0ac6bb1 100644 --- a/aprsd/plugins/fortune.py +++ b/aprsd/plugins/fortune.py @@ -8,6 +8,8 @@ from aprsd.utils import trace LOG = logging.getLogger("APRSD") +DEFAULT_FORTUNE_PATH = '/usr/games/fortune' + class FortunePlugin(plugin.APRSDRegexCommandPluginBase): """Fortune.""" @@ -19,7 +21,8 @@ class FortunePlugin(plugin.APRSDRegexCommandPluginBase): fortune_path = None def setup(self): - self.fortune_path = shutil.which("fortune") + self.fortune_path = shutil.which(DEFAULT_FORTUNE_PATH) + LOG.info(f"Fortune path {self.fortune_path}") if not self.fortune_path: self.enabled = False else: