Skip to content

Commit

Permalink
b4 tool installation: Fallback to pip based installation
Browse files Browse the repository at this point in the history
  • Loading branch information
adityagesh committed Nov 12, 2024
1 parent 481efdb commit ea73202
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lisa/tools/b4.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pathlib
import re
from lisa.executable import Tool
from lisa.operating_system import Posix
from lisa.operating_system import Debian
from lisa.tools.python import Pip
from lisa.util import get_matched_str


Expand All @@ -17,8 +18,12 @@ def can_install(self) -> bool:
return True

def _install(self) -> bool:
if isinstance(self.node.os, Posix):
if isinstance(self.node.os, Debian):
self.node.os.install_packages("b4")
installed = self._check_exists()
if not installed:
pip = self.node.tools[Pip]
pip.install_packages("b4", install_to_user=True)
return self._check_exists()

def am(self, message_id: str, output_dir: pathlib.PurePath) -> pathlib.PurePath:
Expand Down

0 comments on commit ea73202

Please sign in to comment.