8000 _cli: fix warning check · sigstore/sigstore-python@0ebf8c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ebf8c8

Browse files< 8000 a class="prc-Button-ButtonBase-c50BI d-flex d-md-none prc-Button-IconButton-szpyj prc-Link-Link-85e08" data-component="IconButton" type="button" href="/sigstore/sigstore-python/tree/0ebf8c81ed11647a0127ca17870c4fb123cd4b66" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":R7qbab:-loading-announcement" aria-labelledby=":R1qbab:">
committed
_cli: fix warning check
This fixes the check added in #1179 by ensuring that we don't bypass the legacy bundle discovery behavior by accident when trying to suppress the warning. Signed-off-by: William Woodruff <william@trailofbits.com>
1 parent f403812 commit 0ebf8c8

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

sigstore/_cli.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -931,19 +931,16 @@ def _collect_verification_state(
931931
legacy_default_bundle = file.parent / f"{file.name}.sigstore"
932932
bundle = file.parent / f"{file.name}.sigstore.json"
933933

934-
if (
935-
not bundle.is_file()
936-
and legacy_default_bundle.is_file()
937-
# NOTE(ww): Only show this warning if bare materials
938-
# are not provided, since bare materials take precedence over
939-
# a .sigstore bundle.
940-
and not (cert or sig)
941-
):
942-
_logger.warning(
943-
f"{file}: {legacy_default_bundle} should be named {bundle}. "
944-
"Support for discovering 'bare' .sigstore inputs will be deprecated in "
945-
"a future release."
946-
)
934+
if not bundle.is_file() and legacy_default_bundle.is_file():
935+
if not (cert or sig):
936+
# NOTE(ww): Only show this warning if bare materials
937+
# are not provided, since bare materials take precedence over
938+
# a .sigstore bundle.
939+
_logger.warning(
940+
f"{file}: {legacy_default_bundle} should be named {bundle}. "
941+
"Support for discovering 'bare' .sigstore inputs will be deprecated in "
942+
"a future release."
943+
)
947944
bundle = legacy_default_bundle
948945
elif bundle.is_file() and legacy_default_bundle.is_file():
949946
# Don't allow the user to implicitly verify `{input}.sigstore.json` if

0 commit comments

Comments
 (0)
0