Skip to content

Commit 42fdc4a

Browse files
authored
Merge pull request tahoe-lafs#1382 from jwjacobson/1101.feature
1101.feature Add verbose flag to check command
2 parents c363bd8 + 4a36687 commit 42fdc4a

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ repos:
33
hooks:
44
- id: "codechecks"
55
name: "codechecks"
6-
stages: ["push"]
6+
stages: ["pre-push"]
77
language: "system"
88
files: ".py$"
99
entry: "tox -e codechecks"
10-
pass_filenames: true
10+
pass_filenames: false

newsfragments/1101.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adding support for --verbose option

src/allmydata/scripts/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ class CheckOptions(FileStoreOptions):
445445
("verify", None, "Verify all hashes, instead of merely querying share presence."),
446446
("repair", None, "Automatically repair any problems found."),
447447
("add-lease", None, "Add/renew lease on all shares."),
448+
("verbose", None, "Provide verbose output (unimplemented)."),
448449
]
449450
def parseArgs(self, *locations):
450451
self.locations = list(map(argv_to_unicode, locations))

src/allmydata/test/cli/test_check.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ def _check5(args):
151151
self.failIf(" corrupt shares:" in lines, out)
152152
d.addCallback(_check5)
153153

154+
# Testing verbose option
155+
d.addCallback(lambda ign: self.do_cli("check", "--verbose", self.uri))
156+
def _check6(args):
157+
(rc, out, err) = args
158+
self.assertEqual(len(err), 0, err)
159+
self.failUnlessReallyEqual(rc, 0)
160+
lines = out.splitlines()
161+
self.failUnless("Summary: Healthy" in lines, out)
162+
self.failUnless(" good-shares: 10 (encoding is 3-of-10)" in lines, out)
163+
d.addCallback(_check1)
164+
165+
154166
return d
155167

156168
def test_deep_check(self):

0 commit comments

Comments
 (0)