Repository navigation
fix: let --host repeat so one command reaches multiple machines - #35
Merged
Merged
Conversation
argparse kept only the last --host value, silently dropping earlier ones. install.sh already accumulated them. Now cc_peer.py uses action="append" so --host A --host B visits both. Each host's failure is caught and reported independently — one unreachable machine does not prevent the others from being reached. The exit code reflects whether any host failed. send --host A --host B --to worker delivers to worker on both hosts (broadcast). Single-host --json output stays a flat object for backwards compatibility; multiple hosts emit an array. Closes #24
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
cc-peer list --host A --host Bsilently drops A and only talks to B — argparse keeps the last value.install.sh --host A --host Bvisits both. Same flag, opposite behavior.Checking four machines requires a for-loop every time.
Fix
Change
--hostfrom the defaultstoretoaction="append", default=[]. All three commands (list,send,update) now loop over hosts, catching per-host failures independently.Design decisions
send --host A --host B --to workerdelivers toworkeron both hosts (broadcast).--hostsendemits a flat object (backwards-compatible); multiple hosts emit an array.listwith any--hostalways emits an array.Tests
test_list_iterates_over_hosts: both hosts are calledtest_send_delivers_to_both_hosts: broadcast workstest_one_failure_continues: first host fails → second still runs → exit 1test_single_host_send_json_is_flat: backwards-compatible JSON shapeCloses #24