Step 4 of NetOrk/netork#1105, base-package side. Stacked on #40 (merge that first; this PR then shows only its own commit).
napalm_device_types.fixes:
run_fix_steps(steps): runs steps in order, stops at the first failure; a step that raises has failed.
SnmpAgentMixin.configure_snmp_agent(settings): install, configure, firewall, start; SnmpAgentSettingsDict = community, allowed_sources, contact, location, listen. Verification is the caller's, with its own SNMP client.
EnsurePackageMixin.ensure_package(name): installs only what is missing (copes with drivers whose install_package still returns {success, output}).
PackageProxyMixin.configure_package_proxy(url) and ContainerEngineMixin.grant_container_engine_access(user): declared.
FixResultDict lists every step that ran.
None sits on a role base (tested), so callable(getattr(driver, name, None)) stays truthful. run_device_action is marked deprecated; goes in 5.0.
Next: napalm-linux and napalm-bsd implement the steps; netOrk calls the templates with its values (NetOrk/netork#1109).
Step 4 of NetOrk/netork#1105, base-package side. **Stacked on #40** (merge that first; this PR then shows only its own commit).
`napalm_device_types.fixes`:
- `run_fix_steps(steps)`: runs steps in order, stops at the first failure; a step that raises has failed.
- `SnmpAgentMixin.configure_snmp_agent(settings)`: install, configure, firewall, start; `SnmpAgentSettingsDict` = community, allowed_sources, contact, location, listen. Verification is the caller's, with its own SNMP client.
- `EnsurePackageMixin.ensure_package(name)`: installs only what is missing (copes with drivers whose `install_package` still returns `{success, output}`).
- `PackageProxyMixin.configure_package_proxy(url)` and `ContainerEngineMixin.grant_container_engine_access(user)`: declared.
- `FixResultDict` lists every step that ran.
None sits on a role base (tested), so `callable(getattr(driver, name, None))` stays truthful. `run_device_action` is marked deprecated; goes in 5.0.
Next: napalm-linux and napalm-bsd implement the steps; netOrk calls the templates with its values (NetOrk/netork#1109).
Closes #33
Drivers no longer collect over SNMP (docs/STRUCTURE.md). A driver whose
device publishes its health values under OIDs of its own declares them
as SNMP_HEALTH_PROFILE: per value either scalars asked in order or a
table folded by first, average or max, optionally with a pattern for
text answers; memory as total with used or free, or a percentage, in
KiB or bytes; and how to read the interfaces. The application polls
and computes.
HealthMetricsMixin.get_health_metrics now warns that it is deprecated;
it goes in 5.0.
Closes#32
run_device_action was a string dispatch drivers filled with an
application's remediations, values hard-coded inside (community
"public", the caller's address, a /24 firewall rule).
napalm_device_types.fixes declares them as templates instead. A
template runs declared steps in order and stops at the first failure
(run_fix_steps); the driver implements the steps, or overrides the
whole method where its device takes the change in one call; every
value comes from the caller.
- SnmpAgentMixin.configure_snmp_agent(settings): install, configure,
firewall, start. The caller verifies with its own SNMP client.
get_management_peer() (optional) says the address the device sees the
management connection come from, for choosing allowed_sources.
- EnsurePackageMixin.ensure_package(name): install only what is missing.
- PackageProxyMixin.configure_package_proxy(url): declared.
- ContainerEngineMixin.grant_container_engine_access(user): declared.
None is mixed into a role base, so a capability check stays truthful.
Closes#33
christianmanivong
changed title from feat: fix routines as templates with the caller's values; deprecate run_device_action (4.12.0) to feat: fix routines as templates with the caller's values; deprecate run_device_action (4.13.0)2026-10-16 13:29:56 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Step 4 of NetOrk/netork#1105, base-package side. Stacked on #40 (merge that first; this PR then shows only its own commit).
napalm_device_types.fixes:run_fix_steps(steps): runs steps in order, stops at the first failure; a step that raises has failed.SnmpAgentMixin.configure_snmp_agent(settings): install, configure, firewall, start;SnmpAgentSettingsDict= community, allowed_sources, contact, location, listen. Verification is the caller's, with its own SNMP client.EnsurePackageMixin.ensure_package(name): installs only what is missing (copes with drivers whoseinstall_packagestill returns{success, output}).PackageProxyMixin.configure_package_proxy(url)andContainerEngineMixin.grant_container_engine_access(user): declared.FixResultDictlists every step that ran.None sits on a role base (tested), so
callable(getattr(driver, name, None))stays truthful.run_device_actionis marked deprecated; goes in 5.0.Next: napalm-linux and napalm-bsd implement the steps; netOrk calls the templates with its values (NetOrk/netork#1109).
Closes #33
d60b3d3742to9324a5b8f1feat: fix routines as templates with the caller's values; deprecate run_device_action (4.12.0)to feat: fix routines as templates with the caller's values; deprecate run_device_action (4.13.0)