Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose CLI arg in read_ledger.py for read_recovery_files #6896

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [6.0.0-rc1]

[6.0.0-rc1]: https://github.com/microsoft/CCF/releases/tag/6.0.0-rc1

### Added

- The `read-ledger.py` tool now has a `--recovery` argument, which will allow it to parse `.recovery` files. Previously these were ignored (#6896).

## [6.0.0-rc0]

[6.0.0-rc0]: https://github.com/microsoft/CCF/releases/tag/6.0.0-rc0
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ccf"
version = "6.0.0-rc0"
version = "6.0.0-rc1"
authors = [
{ name="CCF Team", email="[email protected]" },
]
16 changes: 14 additions & 2 deletions python/src/ccf/read_ledger.py
Original file line number Diff line number Diff line change
@@ -141,6 +141,7 @@ def run(
tables_regex=None,
insecure_skip_verification=False,
uncommitted=False,
read_recovery_files=False,
tables_format_rules=None,
):
table_filter = re.compile(tables_regex) if tables_regex is not None else None
@@ -166,7 +167,10 @@ def run(
)
ledger_paths = paths
ledger = ccf.ledger.Ledger(
ledger_paths, committed_only=not uncommitted, validator=validator
ledger_paths,
committed_only=not uncommitted,
read_recovery_files=read_recovery_files,
validator=validator,
)

LOG.info(f"Reading ledger from {ledger_paths}")
@@ -226,7 +230,14 @@ def main():
action="store_true",
)
parser.add_argument(
"--uncommitted", help="Also parse uncommitted ledger files", action="store_true"
"--uncommitted",
help="Also parse uncommitted ledger files. Note that if these are in a live node directory, they may be being modified.",
action="store_true",
)
parser.add_argument(
"--recovery",
help="Also parse .recovery ledger files. Note that if these are in a live node directory, they may be being modified.",
action="store_true",
)

display_options = parser.add_mutually_exclusive_group()
@@ -272,6 +283,7 @@ def main():
tables_regex=args.tables,
insecure_skip_verification=args.insecure_skip_verification,
uncommitted=args.uncommitted,
read_recovery_files=args.recovery,
):
sys.exit(1)