Skip to content

Commit

Permalink
stage/copy: fix exception msg when parsing mounts and inputs
Browse files Browse the repository at this point in the history
Functions for parsing mounts and inputs raise an exception if the
referenced entity can't be found in the stage options. However, the
exception message always included the value of the `root` variable,
which is `None` when an exception is risen. Instead of the `root`
value, the `name` variable with the entity name should be used.

Signed-off-by: Tomáš Hozza <[email protected]>
  • Loading branch information
thozza authored and achilleas-k committed Nov 1, 2023
1 parent 49f987f commit 15c3c0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stages/org.osbuild.copy
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def parse_mount(url: ParseResult, args: Dict):
if name:
root = args["mounts"].get(name, {}).get("path")
if not root:
raise ValueError(f"Unknown mount '{root}'")
raise ValueError(f"Unknown mount '{name}'")
else:
root = args["paths"]["mounts"]

Expand All @@ -103,7 +103,7 @@ def parse_input(url: ParseResult, args: Dict):
name = url.netloc
root = args["inputs"].get(name, {}).get("path")
if root is None:
raise ValueError(f"Unknown input '{root}'")
raise ValueError(f"Unknown input '{name}'")

return root

Expand Down

0 comments on commit 15c3c0a

Please sign in to comment.