generic_config_updater: Filename changed & VLAN validator added#1919
generic_config_updater: Filename changed & VLAN validator added#1919qiluo-msft merged 20 commits intosonic-net:masterfrom
Conversation
2) Read conf file from install dir 3) Drop empty keys & tables upon jsonpatch.JsonPatch.apply to be in sync with redis update 4) Prefix service_validator module path with "generic_updater"
2) Added vlan validator 3) Added test code for vlan validator
| for key in set(old_vlan.keys()).union(set(upd_vlan.keys())): | ||
| if (old_vlan.get(key, {}).get("dhcp_servers", []) != | ||
| upd_vlan.get(key, {}).get("dhcp_servers", [])): | ||
| return _service_restart("dhcp_relay") |
There was a problem hiding this comment.
NICE! We just restart dhcp at the first occurrence of mismatch between dhcp_servers in old vs updated.
| "services_to_validate": [ "dhcp-relay" ] | ||
| }, | ||
| "VLAN": { | ||
| "services_to_validate": [ "vlan-service" ] |
There was a problem hiding this comment.
According to the design doc https://github.com/Azure/SONiC/blob/master/doc/config-generic-update-rollback/Json_Change_Application_Design.md#3212-metadata. It fits better as restart-command than services_to_validate #Closed
There was a problem hiding this comment.
This is not blindly restart.
For example, in case of VLAN table update, we call vlan_validator, which may or may not restart dhcp_sevice.
Again a validator, could potentially restart more than one and possibly none too, as in vlan case.
So I prefer this name validator, which is table specific.
There was a problem hiding this comment.
I see the intelligence of restarting dhcp_service for vlan-service. However, the validator is design as read-only operations for the purpose of validation, including validating services are completely restarted and healthy.
There was a problem hiding this comment.
I don't get your last comments. But Design doc updated.
#### What I did Change filename per review comments from last PR. Removed print statement from change_applier Added vlan validator & test code for the same
What I did
Change filename per review comments from last PR.
Removed print statement from change_applier
Added vlan validator & test code for the same
How I did it
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)