Skip to content

Commit

Permalink
Merge branch 'verify-only-fixing'
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Mar 23, 2015
2 parents 54d6f0f + 1de845b commit 7e7f57a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/bundlewrap/cmdline/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,13 @@ def build_parser_bw():
type=str,
help=_("target nodes, groups and/or bundle selectors"),
)
parser_verify.add_argument(
"-F",
"--only-needs-fixing",
action='store_true',
dest='only_needs_fixing',
help=_("only show items that need fixing"),
)
parser_verify.add_argument(
"-p",
"--parallel-nodes",
Expand Down
1 change: 1 addition & 0 deletions src/bundlewrap/cmdline/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def bw_verify(repo, args):
node.verify,
task_id=node.name,
kwargs={
'only_needs_fixing': args['only_needs_fixing'],
'workers': args['item_workers'],
},
)
Expand Down
7 changes: 4 additions & 3 deletions src/bundlewrap/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,10 @@ def upload(self, local_path, remote_path, mode=None, owner="", group=""):
password=self.password,
)

def verify(self, workers=4):
def verify(self, only_needs_fixing=False, workers=4):
verify_items(
self.items,
only_needs_fixing=only_needs_fixing,
workers=workers,
)

Expand Down Expand Up @@ -625,7 +626,7 @@ def test_items(items, workers=1):
))


def verify_items(all_items, workers=1):
def verify_items(all_items, only_needs_fixing=False, workers=1):
items = []
for item in all_items:
if not item.ITEM_TYPE_NAME == 'action' and not item.triggered:
Expand All @@ -652,7 +653,7 @@ def verify_items(all_items, workers=1):
red("✘"),
item_id,
))
else:
elif not only_needs_fixing:
LOG.info("{} {}".format(
green("✓"),
item_id,
Expand Down

0 comments on commit 7e7f57a

Please sign in to comment.