check --only extract broken #217

Closed
opened 2019-09-19 22:15:03 +00:00 by witten · 1 comment
Owner

What I'm trying to do and why

I don't have a concrete use case other than testing the new check --only feature. But one use case I could imagine is running the slow extract consistency check from an infrequent cron job, separate from the regular consistency checks.

Steps to reproduce

Run the following:

borgmatic -c test.yaml -v 2 check --only extract

Actual behavior

# borgmatic -c test.yaml -v 2 check --only extract
usage: borgmatic extract [--repository REPOSITORY] --archive ARCHIVE
                         [--restore-path RESTORE_PATHS [RESTORE_PATHS ...]]
                         [--progress] [-h]
borgmatic extract: error: the following arguments are required: --archive
Error parsing arguments: /root/.local/bin/borgmatic -c test.yaml -v 2 check --only extract

Expected behavior

Run the borgmatic "extract" consistency check instead of erroring.

Other notes / implementation ideas

I think what's going on here is the argument parsing is getting confusing, thinking that we're trying to invoke the separate "extract" sub-command.

Environment

borgmatic version: 1.3.16

borgmatic installation method: pip install --user as root

Borg version: 1.1.10

Python version: 3.7.4

operating system and version: Manjaro stable

#### What I'm trying to do and why I don't have a concrete use case other than testing the new `check --only` feature. But one use case I could imagine is running the slow extract consistency check from an infrequent cron job, separate from the regular consistency checks. #### Steps to reproduce Run the following: ``` borgmatic -c test.yaml -v 2 check --only extract ``` #### Actual behavior ``` # borgmatic -c test.yaml -v 2 check --only extract usage: borgmatic extract [--repository REPOSITORY] --archive ARCHIVE [--restore-path RESTORE_PATHS [RESTORE_PATHS ...]] [--progress] [-h] borgmatic extract: error: the following arguments are required: --archive Error parsing arguments: /root/.local/bin/borgmatic -c test.yaml -v 2 check --only extract ``` #### Expected behavior Run the borgmatic "extract" consistency check instead of erroring. #### Other notes / implementation ideas I think what's going on here is the argument parsing is getting confusing, thinking that we're trying to invoke the separate "extract" sub-command. #### Environment **borgmatic version:** 1.3.16 **borgmatic installation method:** `pip install --user` as root **Borg version:** 1.1.10 **Python version:** 3.7.4 **operating system and version:** Manjaro stable
witten added the
bug
label 2019-09-19 22:15:08 +00:00
Author
Owner

Okay, this is fixed and released (borgmatic 1.3.17). Required a fair amount of refactoring of the argument parsing so that different subparsers don't try to consume each others arguments erroneously.. when the value consumed by one subparser (extract in check --only extract) happens to match the name of another subparser (extract)!

Okay, this is fixed and released (borgmatic 1.3.17). Required a fair amount of refactoring of the argument parsing so that different subparsers don't try to consume each others arguments erroneously.. when the value consumed by one subparser (`extract` in `check --only extract`) happens to match the name of another subparser (`extract`)!
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#217
No description provided.