Skip to content

Commit cacf3a3

Browse files
committed
xo: import xo-cli path from data.TOOLS (and fallback to "xo-cli")
permit to override the xo-cli path locally Signed-off-by: Sebastien Rodot <sebastien.rodot@vates.tech>
1 parent 3dfd00e commit cacf3a3

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

data.py-dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ OTHER_GUEST_TOOLS = {
116116
# Tools
117117
TOOLS: dict[str, str] = {
118118
# "iso-remaster": "/home/user/src/xcpng/xcp/scripts/iso-remaster/iso-remaster.sh",
119+
# "xo-cli": "xo-cli",
119120
}
120121

121122
# Values can be either full URLs or only partial URLs that will be automatically appended to DEF_VM_URL

lib/xo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import subprocess
33

4+
from data import TOOLS
45
from lib.typing import JSONType
56

67
from typing import Dict, Literal, overload
@@ -28,7 +29,7 @@ def xo_cli(action: str, args: Dict[str, str] = {}, *, check: bool = True, simple
2829
def xo_cli(
2930
action: str, args: dict[str, str] = {}, check: bool = True, simple_output: bool = True, use_json: bool = False
3031
) -> subprocess.CompletedProcess[bytes] | JSONType | str:
31-
run_array = ['xo-cli', action]
32+
run_array = [TOOLS.get('xo-cli', 'xo-cli'), action]
3233
if use_json:
3334
run_array += ['--json']
3435
run_array += ["%s=%s" % (key, value) for key, value in args.items()]

0 commit comments

Comments
 (0)