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
1 changed files with 4 additions and 1 deletions

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: