2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[#3025] minor changes to kea-admin

- Reword 'Database version' to 'Schema version'.
- Remove a newline that was present only when running mysql operations
  and not for postgresql operations. It was more visible since now it
  appeared in the kea logs.
- Remove some extraneous exits. They weren't in the way of anything, but
  weren't doing anything either.
This commit is contained in:
Andrei Pavel
2024-02-13 15:17:42 +02:00
parent 253eadd878
commit 0046232406

View File

@@ -275,9 +275,8 @@ mysql_init() {
printf "mysql returned status code %s\n" "${EXIT_CODE}" printf "mysql returned status code %s\n" "${EXIT_CODE}"
if [ "${EXIT_CODE}" -eq 0 ]; then if [ "${EXIT_CODE}" -eq 0 ]; then
printf "Database version reported after initialization: " version=$(checked_mysql_version)
checked_mysql_version printf 'Schema version reported after initialization: %s\n' "${version}"
printf '\n'
fi fi
exit "${EXIT_CODE}" exit "${EXIT_CODE}"
@@ -314,8 +313,7 @@ pgsql_init() {
fi fi
version=$(checked_pgsql_version) version=$(checked_pgsql_version)
printf "Database version reported after initialization: %s\n" "$version" printf 'Schema version reported after initialization: %s\n' "${version}"
exit 0
} }
### Functions that implement database version checking commands ### Functions that implement database version checking commands
@@ -339,10 +337,8 @@ memfile_upgrade() {
# #
# This function prints version before and after upgrade. # This function prints version before and after upgrade.
mysql_upgrade() { mysql_upgrade() {
version=$(checked_mysql_version)
printf "Database version reported before upgrade: " printf 'Schema version reported before upgrade: %s\n' "${version}"
checked_mysql_version
printf '\n'
upgrade_scripts_dir=${scripts_dir}/mysql upgrade_scripts_dir=${scripts_dir}/mysql
@@ -385,14 +381,13 @@ mysql_upgrade() {
--password="${db_password}" "${db_name}" ${extra_arguments} --password="${db_password}" "${db_name}" ${extra_arguments}
done done
printf "Database version reported after upgrade: " version=$(checked_mysql_version)
checked_mysql_version printf 'Schema version reported after upgrade: %s\n' "${version}"
printf '\n'
} }
pgsql_upgrade() { pgsql_upgrade() {
version=$(checked_pgsql_version) version=$(checked_pgsql_version)
printf "Database version reported before upgrade: %s\n" "$version" printf 'Schema version reported before upgrade: %s\n' "${version}"
upgrade_scripts_dir=${scripts_dir}/pgsql upgrade_scripts_dir=${scripts_dir}/pgsql
@@ -434,8 +429,7 @@ pgsql_upgrade() {
done done
version=$(checked_pgsql_version) version=$(checked_pgsql_version)
printf "Database version reported after upgrade: %s\n" "$version" printf 'Schema version reported after upgrade: %s\n' "${version}"
exit 0
} }
# Remove a file if it exists # Remove a file if it exists
@@ -567,7 +561,6 @@ mysql_dump() {
log_info "Removed temporary file ${tmp_file}." log_info "Removed temporary file ${tmp_file}."
log_info "Successfully dumped lease${dhcp_version} to ${dump_file}." log_info "Successfully dumped lease${dhcp_version} to ${dump_file}."
exit 0
} }
### Functions used for dump ### Functions used for dump
@@ -609,7 +602,6 @@ pgsql_dump() {
fi fi
echo lease${dhcp_version} successfully dumped to "${dump_file}" echo lease${dhcp_version} successfully dumped to "${dump_file}"
exit 0
} }
######################## functions used in lease-upload ######################## ######################## functions used in lease-upload ########################
@@ -1086,5 +1078,3 @@ case ${command} in
esac esac
;; ;;
esac esac
exit 0