Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to make config load/reload backward compatible. #1115

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

judyjoseph
Copy link
Contributor

- 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

{
"MGMT_INTERFACE": {
"eth0|10.3.147.46/23": {
"gwaddr": "10.3.146.1"
}
},
"DEVICE_METADATA": {
"localhost": {
"hostname": "sonic"
}
}
}
EOF
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...
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/init_cfg.json -j /dev/stdin --write-to-db
Running command: /usr/bin/db_migrator.py -o migrate
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...

@judyjoseph judyjoseph merged commit 8592d08 into sonic-net:master Sep 15, 2020
@judyjoseph judyjoseph deleted the config_changes branch September 15, 2020 01:46
abdosi pushed a commit that referenced this pull request Sep 19, 2020
Update to handle this style of invoking config reload command "sudo config reload /dev/stdin -y"
REF: https://github.com/Azure/SONiC/wiki/L2-Switch-mode
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
Revert "Revert " [201911]show interface counters for multi ASIC devices
(sonic-net#1104)""
 Revert "Revert "Pfcstat (sonic-net#1097)""
  [show] Fix 'show int neighbor expected' (sonic-net#1106)
   Update argument for docker exec it->i (sonic-net#1118)
     Update to make config load/reload backward compatible. (sonic-net#1115)
     Handling deletion of Port Channel before deletion of its members
     (sonic-net#1062)
    Skip default route present in ASIC-DB but not in APP-DB. (sonic-net#1107)
     [CLI][PFCWD][Multi-ASIC] Added multi ASIC support to 'pfcwd' CLI
     (sonic-net#1102)
       [201911]  Multi asic platform config interface portchannel, show
       transceiver  (sonic-net#1087)
       [drop counters] Fix configuration for counters with lowercase
       names (sonic-net#1103)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants