Two things napalm-device-types already provides, which this driver re-implements.
utils.normalize_mac (napalm_proxmox/utils.py:28)
It parses with netaddr.EUI. napalm-device-types has normalize_mac (dhcp.py:59), and NetOrk matches MACs on that one.
Valid MACs come out the same. Invalid input does not: proxmox rewrites - to : and lowercases, while the base returns the input lowercased and stripped.
Callers: utils.py:166, :243 and interfaces_mixin.py:51, :149, :187, :227, :258.
ProxmoxConfigMixin (config_mixin.py:26) hand-rolls load_merge_candidate/load_replace_candidate, which are identical to each other (:71, :85).
They raise ValueError instead of MergeConfigException/ReplaceConfigException.
They never record the mode, so merge and replace both overwrite /etc/network/interfaces.
compare_config diffs against a cached _running_config instead of a _get_running_config() hook.
Proposal: import the base normalize_mac. Inherit ConfigLifecycleMixin, implement _get_running_config(), keep commit_config, and reject merge mode explicitly or document it.
Prio P4.
From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.
Two things napalm-device-types already provides, which this driver re-implements.
**`utils.normalize_mac`** (`napalm_proxmox/utils.py`:28)
- It parses with `netaddr.EUI`. napalm-device-types has `normalize_mac` (`dhcp.py`:59), and NetOrk matches MACs on that one.
- Valid MACs come out the same. Invalid input does not: proxmox rewrites `-` to `:` and lowercases, while the base returns the input lowercased and stripped.
- Callers: `utils.py`:166, :243 and `interfaces_mixin.py`:51, :149, :187, :227, :258.
**`ProxmoxConfigMixin`** (`config_mixin.py`:26) hand-rolls `load_merge_candidate`/`load_replace_candidate`, which are identical to each other (:71, :85).
- They raise `ValueError` instead of `MergeConfigException`/`ReplaceConfigException`.
- They never record the mode, so merge and replace both overwrite `/etc/network/interfaces`.
- `compare_config` diffs against a cached `_running_config` instead of a `_get_running_config()` hook.
**Proposal:** import the base `normalize_mac`. Inherit `ConfigLifecycleMixin`, implement `_get_running_config()`, keep `commit_config`, and reject merge mode explicitly or document it.
Prio P4.
From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.
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.
Two things napalm-device-types already provides, which this driver re-implements.
utils.normalize_mac(napalm_proxmox/utils.py:28)netaddr.EUI. napalm-device-types hasnormalize_mac(dhcp.py:59), and NetOrk matches MACs on that one.-to:and lowercases, while the base returns the input lowercased and stripped.utils.py:166, :243 andinterfaces_mixin.py:51, :149, :187, :227, :258.ProxmoxConfigMixin(config_mixin.py:26) hand-rollsload_merge_candidate/load_replace_candidate, which are identical to each other (:71, :85).ValueErrorinstead ofMergeConfigException/ReplaceConfigException./etc/network/interfaces.compare_configdiffs against a cached_running_configinstead of a_get_running_config()hook.Proposal: import the base
normalize_mac. InheritConfigLifecycleMixin, implement_get_running_config(), keepcommit_config, and reject merge mode explicitly or document it.Prio P4.
From the NetOrk function index (NetOrk/netork#670); every location was checked against the current code. Paths are relative to each driver repo.