Update to make config load/reload backward compatible. #1115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
To take care of comment #877 (comment). To support the way the config reload command is used in https://github.com/Azure/SONiC/wiki/L2-Switch-mode
- How I did it
Changed os.path.isfile check to os.path.exists.
- How to verify it
Verified the command give in https://github.com/Azure/SONiC/wiki/L2-Switch-mode works ok.
- Previous command output (if the output of a command-line utility has changed)
admin@str-s6000-acs-8:~$ sudo config reload /dev/stdin -y
Executing stop of service telemetry...
Warning: Stopping telemetry.service, but it can still be activated by:
telemetry.timer
Executing stop of service swss...
Executing stop of service lldp...
Executing stop of service pmon...
Executing stop of service bgp...
Executing stop of service hostcfgd...
The config_db file /dev/stdin doesn't exist
Executing reset-failed of service bgp...
Executing reset-failed of service dhcp_relay...
Executing reset-failed of service hostcfgd...
Executing reset-failed of service hostname-config...
Executing reset-failed of service interfaces-config...
Executing reset-failed of service lldp...
Executing reset-failed of service ntp-config...
Executing reset-failed of service pmon...
Executing reset-failed of service radv...
Executing reset-failed of service rsyslog-config...
Executing reset-failed of service snmp...
Executing reset-failed of service swss...
Executing reset-failed of service syncd...
Executing reset-failed of service teamd...
Executing reset-failed of service telemetry...
Executing restart of service hostname-config...
Executing restart of service interfaces-config...
Executing restart of service ntp-config...
Executing restart of service rsyslog-config...
Executing restart of service swss...
Executing restart of service bgp...
Executing restart of service pmon...
Executing restart of service lldp...
Executing restart of service hostcfgd...
Executing restart of service telemetry...
- New command output (if the output of a command-line utility has changed)
admin@str-s6000-acs-8:/$ cat <<EOF | sudo config reload /dev/stdin -y