From c1f5edeb2cb1a39dfbab1813a3bc68ae4c04661d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Prpi=C4=8D?= Date: Fri, 4 Feb 2022 21:20:25 -0500 Subject: [PATCH] Revert "Fix CVE states" This reverts commit 8f0967ecb96649d71b4527086fcd8f02de01bd75. The change introduced by this commit has not been released to currently deployed production version of CVE Services. It will be made available when CVE Services 2.x is generally available. --- cvelib/cli.py | 2 +- tests/test_cli.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cvelib/cli.py b/cvelib/cli.py index 493f0d3..2236b08 100644 --- a/cvelib/cli.py +++ b/cvelib/cli.py @@ -286,7 +286,7 @@ def show_cve(ctx, print_raw, cve_id): @click.option("--year", callback=validate_year, help="Filter by year.") @click.option( "--state", - type=click.Choice(["reserved", "published", "rejected"], case_sensitive=False), + type=click.Choice(["reserved", "public", "reject"], case_sensitive=False), help="Filter by reservation state.", ) @click.option( diff --git a/tests/test_cli.py b/tests/test_cli.py index afc05d6..154bf84 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -51,7 +51,7 @@ def test_cve_list(): "owning_cna": "acme", "requested_by": {"cna": "acme", "user": "ann"}, "reserved": "2021-01-14T18:32:57.955Z", - "state": "PUBLISHED", + "state": "PUBLIC", "time": { "created": "2021-01-14T18:32:57.956Z", "modified": "2021-01-14T18:32:57.956Z", @@ -63,7 +63,7 @@ def test_cve_list(): "owning_cna": "acme", "requested_by": {"cna": "corp", "user": "eve"}, "reserved": "2021-01-14T18:34:50.916Z", - "state": "REJECTED", + "state": "REJECT", "time": { "created": "2021-01-14T18:34:50.917Z", "modified": "2021-01-14T18:34:50.917Z", @@ -76,10 +76,10 @@ def test_cve_list(): result = runner.invoke(cli, DEFAULT_OPTS + ["list"]) assert result.exit_code == 0, result.output assert result.output == ( - "CVE ID STATE OWNING CNA REQUESTED BY RESERVED\n" - "CVE-2021-3001 RESERVED acme bob (acme) Thu Jan 14 18:32:19 2021\n" - "CVE-2021-3002 PUBLISHED acme ann (acme) Thu Jan 14 18:32:57 2021\n" - "CVE-2021-3003 REJECTED acme eve (corp) Thu Jan 14 18:34:50 2021\n" + "CVE ID STATE OWNING CNA REQUESTED BY RESERVED\n" + "CVE-2021-3001 RESERVED acme bob (acme) Thu Jan 14 18:32:19 2021\n" + "CVE-2021-3002 PUBLIC acme ann (acme) Thu Jan 14 18:32:57 2021\n" + "CVE-2021-3003 REJECT acme eve (corp) Thu Jan 14 18:34:50 2021\n" )