1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-21 23:55:17 -05:00

Force fortune path during setup test

For whatever reason shutil.which() can't find
fortune in the path, unless you specify the entire path.
This commit is contained in:
Hemna 2024-01-09 01:30:43 +00:00
parent 026a64c003
commit 12a3113192

View File

@ -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: