vars: make wording nicer when multiple vars are found
This commit is contained in:
@@ -28,10 +28,8 @@ def get_var(base_dir: str, machine_name: str, var_id: str) -> Var:
|
|||||||
msg = f"No var found for search string: {var_id}"
|
msg = f"No var found for search string: {var_id}"
|
||||||
raise ClanError(msg)
|
raise ClanError(msg)
|
||||||
if len(results) > 1:
|
if len(results) > 1:
|
||||||
error = (
|
error = f"Found multiple vars for {var_id}:\n - " + "\n - ".join(
|
||||||
f"Found multiple vars for {var_id}:\n - "
|
[str(var) for var in results]
|
||||||
+ "\n - ".join([str(var) for var in results])
|
|
||||||
+ "\nBe more specific."
|
|
||||||
)
|
)
|
||||||
raise ClanError(error)
|
raise ClanError(error)
|
||||||
# we have exactly one result at this point
|
# we have exactly one result at this point
|
||||||
|
|||||||
Reference in New Issue
Block a user