Skip to content

Commit

Permalink
Merge pull request #384 from projectsyn/fix/inventory-components-extr…
Browse files Browse the repository at this point in the history
…a-values

Fix unreliable path type conversion in `commodore inventory components`
  • Loading branch information
simu authored Nov 17, 2021
2 parents c95cc77 + 0b827dd commit b88992c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions commodore/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def inventory(config: Config, verbose):
+ "Can be repeated."
),
multiple=True,
type=click.Path(exists=True, file_okay=True, dir_okay=False, path_type=Path),
type=click.Path(exists=True, file_okay=True, dir_okay=False),
)
@click.option(
" / -A",
Expand All @@ -394,14 +394,15 @@ def component_versions(
verbose,
global_config: str,
output_format: str,
values: Iterable[Path],
values: Iterable[str],
allow_missing_classes: bool,
):
config.update_verbosity(verbose)
extra_values = [Path(v) for v in values]
try:
components = extract_components(
config,
InventoryFacts(global_config, None, values, allow_missing_classes),
InventoryFacts(global_config, None, extra_values, allow_missing_classes),
)
except ValueError as e:
raise click.ClickException(f"While extracting components: {e}") from e
Expand Down

0 comments on commit b88992c

Please sign in to comment.