Skip to content
New issue

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

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

Already on GitHub? # to your account

Modifying ZTP to adapt to force config reload #29

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/usr/lib/ztp/ztp-profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ load_config()
fi

if [ -e ${DEST_FILE} ]; then
config reload ${DEST_FILE} -y
config reload ${DEST_FILE} -y -f
rm -f ${TMP_ZTP_CONFIG_DB_JSON}
return 0
else
Expand Down Expand Up @@ -256,7 +256,7 @@ if [ "$CMD" = "remove" ] ; then
if [ -e ${CONFIG_DB_JSON} ]; then
updateActivity "Removing ZTP configuration profile and loading startup configuration"
echo "Removing ZTP configuration profile. Loading startup configuration."
config reload ${CONFIG_DB_JSON} -y
config reload ${CONFIG_DB_JSON} -y -f
else
updateActivity "Removing ZTP configuration profile and loading factory default configuration"
echo "Removing ZTP configuration profile. Loading factory default configuration."
Expand Down
2 changes: 1 addition & 1 deletion tests/test_configdb-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def test_json_config_valid_reload(self, tmpdir):
assert(rc == 0)

# Restore initial configuration
cmd = 'config reload -y ' + str(fh_before)
cmd = 'config reload -y -f ' + str(fh_before)
rc = runCommand(cmd, capture_stdout=False)
assert(rc == 0)
rc = runCommand('config save -y', capture_stdout=False)