From 5fc9adf1d4b3aa5ef3ada08fef360c75a49291d0 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sun, 22 Mar 2020 22:08:29 -0700 Subject: [PATCH] fix default juniper commands; fix custom command import; fix incorrect default force_cidr setting --- docs/docs/devices.mdx | 2 +- hyperglass/configuration/models/commands.py | 18 +++++++++--------- hyperglass/configuration/models/vrfs.py | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/docs/devices.mdx b/docs/docs/devices.mdx index 9b565dd..a2dacba 100644 --- a/docs/docs/devices.mdx +++ b/docs/docs/devices.mdx @@ -92,7 +92,7 @@ May be set to `null` to disable IPv6 for this VRF, on the parent device. | Parameter | Type | Default | Description | | :-------------------- | :-----: | :------ | :------------------------------------------------------------------------------------------------------------------------------ | | `source_address` | String | | Device's source IPv6 address for directed queries (ping, traceroute). | -| `force_cidr` | Boolean | `false` | Convert host queries to the highest allowed prefix-length (defined in the le field) | +| `force_cidr` | Boolean | `true` | Convert host queries to the highest allowed prefix-length (defined in the le field) | | `access_list` | | | IPv6 Access List Configuration | #### `access_list` diff --git a/hyperglass/configuration/models/commands.py b/hyperglass/configuration/models/commands.py index ea961f0..c900085 100644 --- a/hyperglass/configuration/models/commands.py +++ b/hyperglass/configuration/models/commands.py @@ -69,7 +69,7 @@ class Commands(HyperglassModel): """ obj = Commands() for (nos, cmds) in input_params.items(): - setattr(Commands, nos, Command(**cmds)) + setattr(obj, nos, Command(**cmds)) return obj class CiscoIOS(Command): @@ -182,26 +182,26 @@ class Commands(HyperglassModel): """Validation model for non-default ipv4 commands.""" bgp_route: StrictStr = "show route protocol bgp table inet6.0 {target} detail" - bgp_aspath: StrictStr = 'show route protocol bgp aspath-regex "{target}"' - bgp_community: StrictStr = "show route protocol bgp community {target}" + bgp_aspath: StrictStr = 'show route protocol bgp table inet6.0 aspath-regex "{target}"' + bgp_community: StrictStr = "show route protocol bgp table inet6.0 community {target}" ping: StrictStr = "ping inet6 {target} count 5 source {source}" traceroute: StrictStr = "traceroute inet6 {target} wait 1 source {source}" class VPNIPv4(Command.VPNIPv4): """Validation model for non-default ipv6 commands.""" - bgp_route: StrictStr = "show route protocol bgp table {vrf} {target} detail" - bgp_aspath: StrictStr = 'show route protocol bgp table {vrf} aspath-regex "{target}"' - bgp_community: StrictStr = "show route protocol bgp table {vrf} community {target}" + bgp_route: StrictStr = "show route protocol bgp table {vrf}.inet.0 {target} detail" + bgp_aspath: StrictStr = 'show route protocol bgp table {vrf}.inet.0 aspath-regex "{target}"' + bgp_community: StrictStr = "show route protocol bgp table {vrf}.inet.0 community {target}" ping: StrictStr = "ping inet routing-instance {vrf} {target} count 5 source {source}" traceroute: StrictStr = "traceroute inet routing-instance {vrf} {target} wait 1 source {source}" class VPNIPv6(Command.VPNIPv6): """Validation model for non-default ipv6 commands.""" - bgp_route: StrictStr = "show route protocol bgp table {vrf} {target} detail" - bgp_aspath: StrictStr = 'show route protocol bgp table {vrf} aspath-regex "{target}"' - bgp_community: StrictStr = "show route protocol bgp table {vrf} community {target}" + bgp_route: StrictStr = "show route protocol bgp table {vrf}.inet6.0 {target} detail" + bgp_aspath: StrictStr = 'show route protocol bgp table {vrf}.inet6.0 aspath-regex "{target}"' + bgp_community: StrictStr = "show route protocol bgp table {vrf}.inet6.0 community {target}" ping: StrictStr = "ping inet6 routing-instance {vrf} {target} count 5 source {source}" traceroute: StrictStr = "traceroute inet6 routing-instance {vrf} {target} wait 1 source {source}" diff --git a/hyperglass/configuration/models/vrfs.py b/hyperglass/configuration/models/vrfs.py index bef2c9d..46a50af 100644 --- a/hyperglass/configuration/models/vrfs.py +++ b/hyperglass/configuration/models/vrfs.py @@ -179,7 +179,7 @@ class DeviceVrf4(HyperglassModelExtra): source_address: IPv4Address access_list: List[AccessList4] = [AccessList4()] - force_cidr: StrictBool = False + force_cidr: StrictBool = True class DeviceVrf6(HyperglassModelExtra): @@ -187,7 +187,7 @@ class DeviceVrf6(HyperglassModelExtra): source_address: IPv6Address access_list: List[AccessList6] = [AccessList6()] - force_cidr: StrictBool = False + force_cidr: StrictBool = True class Vrf(HyperglassModel):