You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue was found while debugging issue openconfig model HA "PLUG-8575". election-option/prempt is not set to default value false unless device priority is explicitly specified in the request
Expected behavior
config of device priority should not interfere with configuration of preempt field field.
and this command
gnmic --config ~/gnmicset.yaml set --update-path / --update-file ha.json
This is the code where logic is wrong. id someone selects preemptive field to be false and there is no device priority then the logic to set ans.ElectionOption will not be invoked.
It's a little hard to follow this repro but let me take a few guesses here.
You have initially configured HA to have preemptive=true
You later try to set preemptive=false, but you also don't want to have a priority
In this case, as long as you're doing an edit and not a set, PAN-OS will change the config to have default values for anything not specified. And in the case of the preemptive field, this will set it to preemptive=false.
So it seems like you're doing a set, and if that's the case, that's incorrect. You need to be doing an edit.
Describe the bug
Issue was found while debugging issue openconfig model HA "PLUG-8575". election-option/prempt is not set to default value false unless device priority is explicitly specified in the request
Expected behavior
config of device priority should not interfere with configuration of preempt field field.
Current behavior
Possible solution
Steps to reproduce
please use this json
test@R320:~/octest/json-files$ cat ha.json
{
"ha-groups": {
"ha-group": [
{
"config": {
"ha-config-sync": true,
"ha-enabled": true,
"ha-session-sync": true,
"hello-interval": 8001,
"id": 1
},
"control-link": {
"backup": {
"config": {
"control-link-gateway": "60.1.1.1",
"control-link-interface": "ha1-b",
"control-link-ipv4": "60.1.1.3/24",
"control-link-peer-ipv4": "60.1.1.4/24"
}
},
"config": {
"control-link-gateway": "50.1.1.1",
"control-link-interface": "ha1-a",
"control-link-ipv4": "50.1.1.3/24",
"control-link-peer-ipv4": "50.1.1.4/24"
}
},
"data-link": {
"backup": {
"config": {
"data-link-gateway": "80.1.1.1",
"data-link-interface": "ethernet1/6",
"data-link-ipv4": "80.1.1.3/24"
}
},
"config": {
"data-link-gateway": "70.1.1.1",
"data-link-interface": "hsci",
"data-link-ipv4": "70.1.1.3/24"
}
},
"id": 1,
"interface-groups": {
"interface-group": [
{
"config": {
"group-policy": "ANY",
"id": "link-34",
"monitored-interfaces": [
"ethernet1/3",
"ethernet1/4"
]
},
"id": "link-34"
},
{
"config": {
"group-policy": "ANY",
"id": "link-5",
"monitored-interfaces": [
"ethernet1/5"
]
},
"id": "link-5"
},
{
"config": {
"group-policy": "ALL",
"id": "link-6",
"monitored-interfaces": [
"ethernet1/6"
]
},
"id": "link-6"
}
]
}
}
]
}
}
and this command
gnmic --config ~/gnmicset.yaml set --update-path / --update-file ha.json
This is the code where logic is wrong. id someone selects preemptive field to be false and there is no device priority then the logic to set ans.ElectionOption will not be invoked.
if e.ElectionDevicePriority != "" || e.ElectionPreemptive ||
e.ElectionHeartBeatBackup {
ans.ElectionOption = &electionOption{
DevicePriority: e.ElectionDevicePriority,
Preemptive: util.YesNo(e.ElectionPreemptive),
HeartBeatBackup: util.YesNo(e.ElectionHeartBeatBackup),
}
}
Screenshots
Context
Your Environment
The text was updated successfully, but these errors were encountered: