summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2024-02-13 14:17:42 +0100
committerAndrei Pavel <andrei@isc.org>2024-02-22 08:57:35 +0100
commit0046232406130528155e4c47ed845cbbdac76fb6 (patch)
tree7ba8a8ab0c49daf3a902d5953920cbc2c6487e38
parent[#3025] add ability to inherit env in ProcessSpawn (diff)
downloadkea-0046232406130528155e4c47ed845cbbdac76fb6.tar.xz
kea-0046232406130528155e4c47ed845cbbdac76fb6.zip
[#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.
-rw-r--r--src/bin/admin/kea-admin.in28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/bin/admin/kea-admin.in b/src/bin/admin/kea-admin.in
index 034a0eea19..a2617b1d9e 100644
--- a/src/bin/admin/kea-admin.in
+++ b/src/bin/admin/kea-admin.in
@@ -275,9 +275,8 @@ mysql_init() {
printf "mysql returned status code %s\n" "${EXIT_CODE}"
if [ "${EXIT_CODE}" -eq 0 ]; then
- printf "Database version reported after initialization: "
- checked_mysql_version
- printf '\n'
+ version=$(checked_mysql_version)
+ printf 'Schema version reported after initialization: %s\n' "${version}"
fi
exit "${EXIT_CODE}"
@@ -314,8 +313,7 @@ pgsql_init() {
fi
version=$(checked_pgsql_version)
- printf "Database version reported after initialization: %s\n" "$version"
- exit 0
+ printf 'Schema version reported after initialization: %s\n' "${version}"
}
### Functions that implement database version checking commands
@@ -339,10 +337,8 @@ memfile_upgrade() {
#
# This function prints version before and after upgrade.
mysql_upgrade() {
-
- printf "Database version reported before upgrade: "
- checked_mysql_version
- printf '\n'
+ version=$(checked_mysql_version)
+ printf 'Schema version reported before upgrade: %s\n' "${version}"
upgrade_scripts_dir=${scripts_dir}/mysql
@@ -385,14 +381,13 @@ mysql_upgrade() {
--password="${db_password}" "${db_name}" ${extra_arguments}
done
- printf "Database version reported after upgrade: "
- checked_mysql_version
- printf '\n'
+ version=$(checked_mysql_version)
+ printf 'Schema version reported after upgrade: %s\n' "${version}"
}
pgsql_upgrade() {
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
@@ -434,8 +429,7 @@ pgsql_upgrade() {
done
version=$(checked_pgsql_version)
- printf "Database version reported after upgrade: %s\n" "$version"
- exit 0
+ printf 'Schema version reported after upgrade: %s\n' "${version}"
}
# Remove a file if it exists
@@ -567,7 +561,6 @@ mysql_dump() {
log_info "Removed temporary file ${tmp_file}."
log_info "Successfully dumped lease${dhcp_version} to ${dump_file}."
- exit 0
}
### Functions used for dump
@@ -609,7 +602,6 @@ pgsql_dump() {
fi
echo lease${dhcp_version} successfully dumped to "${dump_file}"
- exit 0
}
######################## functions used in lease-upload ########################
@@ -1086,5 +1078,3 @@ case ${command} in
esac
;;
esac
-
-exit 0