netboot 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {netboot-0.2.2 → netboot-0.2.3}/CHANGELOG.md +13 -1
- {netboot-0.2.2 → netboot-0.2.3}/PKG-INFO +1 -1
- {netboot-0.2.2 → netboot-0.2.3}/pyproject.toml +1 -1
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/AGENTS.md +6 -6
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/engine.py +29 -30
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_engine_robustness.py +27 -16
- {netboot-0.2.2 → netboot-0.2.3}/.gitignore +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/AGENTS.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/LICENSE +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/README.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/benchmarks/README.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/benchmarks/bench_netboot.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/benchmarks/results/netboot.json +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/docs/api.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/docs/changelog.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/docs/cli.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/docs/configuration.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/docs/extending.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/docs/index.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/examples/README.md +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/examples/config/pixie.yaml +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/examples/plugins/recording.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/examples/templates/debian/boot.cfg +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/examples/templates/debian/install.ks.j2 +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/mkdocs.yml +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/__init__.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/__main__.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/_version.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/cmds/__init__.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/cmds/complete.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/cmds/initiate.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/content/__init__.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/dhcp/__init__.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/dhcp/dhcpd.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/dhcp/dnsmasq.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/dhcp/kea.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/dhcp/options.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/dhcp/windhcp.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/logging.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/main.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/py.typed +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/templates/__init__.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/templates/common.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/templates/jinja.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/templates/shell.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/utils/__init__.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/utils/config.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/utils/dicts.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/utils/misc.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/src/netboot/utils/net.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/conftest.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_api_contracts.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_cli.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_cli_discovery.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_config_discovery.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_content.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_dhcp.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_dhcp_dhcpd.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_dhcp_dnsmasq.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_dhcp_kea.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_dhcp_options.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_dhcp_windhcp.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_hooks.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_lookup.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_render.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_target.py +0 -0
- {netboot-0.2.2 → netboot-0.2.3}/tests/test_utils.py +0 -0
|
@@ -6,6 +6,17 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.2.3] - 2026-09-23
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- One DHCP server being offline no longer fails `pixie initiate` or
|
|
13
|
+
`pixie complete`. Arming is meant to be best effort, but since 0.2.0 it
|
|
14
|
+
stopped at the first failing server and rolled the others back. `initiate`
|
|
15
|
+
now tries every server in the zone, logs each failure as a warning, and fails
|
|
16
|
+
only when no server could be armed. `complete` logs a failing server as a
|
|
17
|
+
warning and still exits 0, so read the log if you need to know every server
|
|
18
|
+
was disarmed.
|
|
19
|
+
|
|
9
20
|
## [0.2.2] - 2026-09-21
|
|
10
21
|
|
|
11
22
|
netboot moves to netimps 0.3.1 and yaconfiglib 0.13. If a plugin, hook or
|
|
@@ -543,7 +554,8 @@ First packaged release: the `netboot` library with the `pixie` command line.
|
|
|
543
554
|
config value construction no longer swallows non-`TypeError` errors; repo
|
|
544
555
|
`joinpath` keeps `.local` a path so chained joins work.
|
|
545
556
|
|
|
546
|
-
[Unreleased]: https://github.com/jose-pr/netboot/compare/v0.2.
|
|
557
|
+
[Unreleased]: https://github.com/jose-pr/netboot/compare/v0.2.3...HEAD
|
|
558
|
+
[0.2.3]: https://github.com/jose-pr/netboot/compare/v0.2.2...v0.2.3
|
|
547
559
|
[0.2.2]: https://github.com/jose-pr/netboot/compare/v0.2.1...v0.2.2
|
|
548
560
|
[0.2.1]: https://github.com/jose-pr/netboot/compare/v0.2.0...v0.2.1
|
|
549
561
|
[0.2.0]: https://github.com/jose-pr/netboot/compare/v0.1.3...v0.2.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: netboot
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: PXE provisioning management: render netboot artifacts and drive DHCP for targets
|
|
5
5
|
Project-URL: Homepage, https://github.com/jose-pr/netboot/
|
|
6
6
|
Project-URL: Issues, https://github.com/jose-pr/netboot/issues
|
|
@@ -150,12 +150,12 @@ is the same object. `netboot.netutils` remains an alias for
|
|
|
150
150
|
process's working directory; an absolute path or a URI is used as given.
|
|
151
151
|
- **`.pxe_init(netboot) -> Self`** / **`.pxe_complete(netboot) -> Self`** —
|
|
152
152
|
arm/disarm every `dhcpzone.dhcpservers` for this context; called by
|
|
153
|
-
`Pixie.initialize`/`.complete`, not usually invoked directly.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
`Pixie.initialize`/`.complete`, not usually invoked directly. Both try
|
|
154
|
+
every backend. `pxe_init` logs a backend that raises as a **warning** and
|
|
155
|
+
carries on; it raises (the first error) only when **no** backend could be
|
|
156
|
+
armed, and nothing is rolled back, so a target may end up armed on some
|
|
157
|
+
servers and not others. `pxe_complete` never raises for a backend: each
|
|
158
|
+
failure is logged as a warning and the rest are still disarmed.
|
|
159
159
|
|
|
160
160
|
## DHCP (`netboot.dhcp`)
|
|
161
161
|
|
|
@@ -7,6 +7,7 @@ whole implementation.
|
|
|
7
7
|
|
|
8
8
|
import datetime
|
|
9
9
|
import enum as _enum
|
|
10
|
+
import logging
|
|
10
11
|
import typing as _ty
|
|
11
12
|
from argparse import Namespace
|
|
12
13
|
from copy import deepcopy
|
|
@@ -199,51 +200,49 @@ class PixieContext(Namespace):
|
|
|
199
200
|
return self.repos.get(resource.src)
|
|
200
201
|
|
|
201
202
|
def pxe_init(self, config: "Pixie"):
|
|
202
|
-
"""Arm every DHCP backend for this target,
|
|
203
|
+
"""Arm every DHCP backend for this target, succeeding if any one does.
|
|
203
204
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
backends back before re-raising.
|
|
205
|
+
Every backend is tried. A backend that fails is logged as a warning and
|
|
206
|
+
skipped, so one server being offline does not block the others; the
|
|
207
|
+
first error is raised only when no backend could be armed.
|
|
208
208
|
"""
|
|
209
|
-
|
|
209
|
+
first_error = None
|
|
210
|
+
armed = 0
|
|
210
211
|
for dhcpserver in self.dhcpzone.dhcpservers:
|
|
211
212
|
try:
|
|
212
213
|
dhcpserver.add_target(self)
|
|
213
|
-
except Exception:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
214
|
+
except Exception as exc:
|
|
215
|
+
LOGGER.warning(
|
|
216
|
+
"could not arm %s on %s: %s",
|
|
217
|
+
self.target._id,
|
|
218
|
+
getattr(dhcpserver, "uri", dhcpserver),
|
|
219
|
+
exc,
|
|
220
|
+
exc_info=LOGGER.isEnabledFor(logging.DEBUG),
|
|
221
|
+
)
|
|
222
|
+
first_error = first_error or exc
|
|
223
|
+
else:
|
|
224
|
+
armed += 1
|
|
225
|
+
if first_error is not None and not armed:
|
|
226
|
+
raise first_error
|
|
225
227
|
return self
|
|
226
228
|
|
|
227
229
|
def pxe_complete(self, config: "Pixie"):
|
|
228
|
-
"""Disarm every DHCP backend
|
|
230
|
+
"""Disarm every DHCP backend; a failure is a warning, never an error.
|
|
229
231
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
the first error is raised once they have all had their turn.
|
|
232
|
+
Every backend is tried, and one that fails is logged and skipped, so
|
|
233
|
+
the rest are still disarmed.
|
|
233
234
|
"""
|
|
234
|
-
first_error = None
|
|
235
235
|
for dhcpserver in self.dhcpzone.dhcpservers:
|
|
236
236
|
try:
|
|
237
237
|
dhcpserver.remove_target(self)
|
|
238
238
|
except Exception as exc:
|
|
239
|
-
LOGGER.
|
|
240
|
-
"could not disarm %s on %s",
|
|
239
|
+
LOGGER.warning(
|
|
240
|
+
"could not disarm %s on %s: %s",
|
|
241
241
|
self.target._id,
|
|
242
242
|
getattr(dhcpserver, "uri", dhcpserver),
|
|
243
|
+
exc,
|
|
244
|
+
exc_info=LOGGER.isEnabledFor(logging.DEBUG),
|
|
243
245
|
)
|
|
244
|
-
first_error = first_error or exc
|
|
245
|
-
if first_error is not None:
|
|
246
|
-
raise first_error
|
|
247
246
|
return self
|
|
248
247
|
|
|
249
248
|
def _template_names(self, suffix: Union[list[str], str], **options) -> list[str]:
|
|
@@ -706,7 +705,7 @@ class Pixie:
|
|
|
706
705
|
def initialize(self, target: "PixieTarget"):
|
|
707
706
|
"""Arm DHCP for `target` and return its context.
|
|
708
707
|
|
|
709
|
-
|
|
708
|
+
A backend that fails is a warning; it raises only if none could be armed.
|
|
710
709
|
"""
|
|
711
710
|
target = self.hook(PixieEvent.StartPixieInitialize, target)
|
|
712
711
|
ctx = self.make_context(target)
|
|
@@ -716,7 +715,7 @@ class Pixie:
|
|
|
716
715
|
def complete(self, target: "PixieTarget"):
|
|
717
716
|
"""Disarm DHCP for `target` and return its context.
|
|
718
717
|
|
|
719
|
-
Every backend is tried
|
|
718
|
+
Every backend is tried; one that fails is logged as a warning.
|
|
720
719
|
"""
|
|
721
720
|
target = self.hook(PixieEvent.StartPixieComplete, target)
|
|
722
721
|
ctx = self.make_context(target, require_image=False)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Engine behaviour under partly-broken input and partly-failing backends.
|
|
2
2
|
|
|
3
3
|
Each case here is a crash or a silent wrong answer the 2026-09-17 review
|
|
4
|
-
reproduced:
|
|
4
|
+
reproduced: an offline DHCP server, a retired image blocking cleanup, a global
|
|
5
5
|
that replaced the render context, a zone chosen by declaration order.
|
|
6
6
|
"""
|
|
7
7
|
|
|
@@ -61,28 +61,39 @@ class rollback(_Recorder): # scheme `rollback://`
|
|
|
61
61
|
pass
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
def
|
|
64
|
+
def test_arming_survives_a_failing_backend_with_a_warning(caplog):
|
|
65
65
|
engine = _engine()
|
|
66
66
|
zone = engine.dhcpzones["lan"]
|
|
67
|
-
zone.dhcpservers[
|
|
68
|
-
with
|
|
67
|
+
zone.dhcpservers[0].fail_on = "add"
|
|
68
|
+
with caplog.at_level(logging.WARNING, logger="netboot"):
|
|
69
69
|
engine.initialize(engine.lookup_target("host1"))
|
|
70
|
-
# b
|
|
71
|
-
assert _Recorder.calls == [
|
|
72
|
-
|
|
73
|
-
("arm", "rollback://b"),
|
|
74
|
-
("disarm", "rollback://a"),
|
|
75
|
-
]
|
|
70
|
+
# a is offline; b is still armed and nothing is rolled back.
|
|
71
|
+
assert _Recorder.calls == [("arm", "rollback://a"), ("arm", "rollback://b")]
|
|
72
|
+
assert "could not arm host1 on rollback://a" in caplog.text
|
|
76
73
|
|
|
77
74
|
|
|
78
|
-
def
|
|
75
|
+
def test_arming_raises_when_every_backend_fails():
|
|
79
76
|
engine = _engine()
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
with pytest.raises(RuntimeError):
|
|
77
|
+
for server in engine.dhcpzones["lan"].dhcpservers:
|
|
78
|
+
server.fail_on = "add"
|
|
79
|
+
with pytest.raises(RuntimeError, match="rollback://a refused to arm"):
|
|
80
|
+
engine.initialize(engine.lookup_target("host1"))
|
|
81
|
+
assert _Recorder.calls == [("arm", "rollback://a"), ("arm", "rollback://b")]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def test_disarm_failures_are_warnings(caplog):
|
|
85
|
+
engine = _engine()
|
|
86
|
+
for server in engine.dhcpzones["lan"].dhcpservers:
|
|
87
|
+
server.fail_on = "remove"
|
|
88
|
+
with caplog.at_level(logging.WARNING, logger="netboot"):
|
|
83
89
|
engine.complete(engine.lookup_target("host1"))
|
|
84
|
-
#
|
|
85
|
-
assert
|
|
90
|
+
# Every backend is tried, and none of the failures is raised.
|
|
91
|
+
assert _Recorder.calls == [
|
|
92
|
+
("disarm", "rollback://a"),
|
|
93
|
+
("disarm", "rollback://b"),
|
|
94
|
+
]
|
|
95
|
+
assert "could not disarm host1 on rollback://a" in caplog.text
|
|
96
|
+
assert "could not disarm host1 on rollback://b" in caplog.text
|
|
86
97
|
|
|
87
98
|
|
|
88
99
|
def test_complete_works_when_the_image_is_no_longer_configured(caplog):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|