bundlewrap/hooks/skip_local_nodes.py
CroneKorkN 730625e36c
libs/hooks/bin: add one-line module docstrings and # purpose: headers
every libs/*.py and hooks/*.py now starts with a one-line module
docstring; every bin/* script starts with a `# purpose:` header.
discovery-by-`ls`-and-read instead of by index.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 15:36:19 +02:00

8 lines
382 B
Python

"""skip_local_nodes: skip apply on `localhost` nodes whose metadata `id` doesn't match this host's local_id."""
from bundlewrap.exceptions import SkipNode
def node_apply_start(repo, node, interactive, **kwargs):
if node.hostname == 'localhost':
if node.metadata.get('id') != repo.libs.local.id():
raise SkipNode('bw is not currently running on this node')