diff options
| author | Alexandre Derumier via pve-devel <pve-devel@lists.proxmox.com> | 2024-04-16 18:24:50 +0200 |
|---|---|---|
| committer | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2024-04-22 13:56:48 +0200 |
| commit | c2473c7d65bc86980d3d3585f340ec504f1eebde (patch) | |
| tree | cf3bcb3600725344a8ac7835f4aadf3722d878f6 /src | |
| parent | 51c766f8a00a8a447bdb4bbf6e567eee04deb95c (diff) | |
fix #5344: isis: add isis networkid parser
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/PVE/Network/SDN/Controllers/IsisPlugin.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/PVE/Network/SDN/Controllers/IsisPlugin.pm b/src/PVE/Network/SDN/Controllers/IsisPlugin.pm index afea82e..97c6876 100644 --- a/src/PVE/Network/SDN/Controllers/IsisPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/IsisPlugin.pm @@ -17,6 +17,16 @@ sub type { return 'isis'; } +PVE::JSONSchema::register_format('pve-sdn-isis-net', \&pve_verify_sdn_isis_net); +sub pve_verify_sdn_isis_net { + my ($net) = @_; + + if ($net !~ m/^[a-fA-F0-9]{2}(\.[a-fA-F0-9]{4}){3,9}\.[a-fA-F0-9]{2}$/) { + die "value does not look like a valid isis net\n"; + } + return $net; +} + sub properties { return { 'isis-domain' => { @@ -29,7 +39,7 @@ sub properties { }, 'isis-net' => { description => "ISIS network entity title.", - type => 'string' + type => 'string', format => 'pve-sdn-isis-net', }, }; } |
