napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

fix multihop ttl to its default value in get_bgp_config() #215

Closed ckishimo closed 6 years ago

ckishimo commented 6 years ago

This fixes the multihop_ttl value in get_bgp_config() when the multihop command is configured but without an specific ttl value. So the following configuration:

group internal {
    type internal;
    multihop;
    local-address 10.99.1.2;
    neighbor 10.10.10.10 {
        description routerA;
        cluster 2.2.2.2;
    }
    neighbor 20.20.20.20 {
        description routerB;
    }
}

returns a multihop_ttl value of 0

{
    "internal": {
        "apply_groups": [],
        "description": "",
        "export_policy": "",
        "import_policy": "",
        "local_address": "10.99.1.2",
        "local_as": 0,
        "multihop_ttl": 0,
        "multipath": false,
        "neighbors": {
                .....
}

when I believe it should be set to its default value. Now the problem is how to determine its default value (I ignore if that changes across platforms and versions), so I set it to the default value 64 (according to Junos documentation). Please let me know. Thanks

    "internal": {
        "apply_groups": [],
        "description": "",
        "export_policy": "",
        "import_policy": "",
        "local_address": "10.99.1.2",
        "local_as": 0,
        "multihop_ttl": 64,
        "multipath": false,
        "neighbors": {
coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 78.55% when pulling 7efaa947c4649f5000af495826a482c8c02a8045 on ckishimo:devel-hop into b087b8b0ea90d0b8fb88a3315bc72e97b36d5d44 on napalm-automation:develop.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 78.55% when pulling 7efaa947c4649f5000af495826a482c8c02a8045 on ckishimo:devel-hop into b087b8b0ea90d0b8fb88a3315bc72e97b36d5d44 on napalm-automation:develop.

mirceaulinic commented 6 years ago

Thanks @ckishimo