Always use get_save_path to get the 'path' option
This help deduplicate the code. Use a single function instead of repeat the same logic. Signed-off-by: Kairui Song <kasong@redhat.com> Acked-by: Pingfan Liu <piliu@redhat.com>
This commit is contained in:
parent
d10f202996
commit
03111c797b
@ -428,12 +428,7 @@ default_dump_target_install_conf()
|
|||||||
|
|
||||||
is_user_configured_dump_target && return
|
is_user_configured_dump_target && return
|
||||||
|
|
||||||
_save_path=$(get_option_value "path")
|
_save_path=$(get_save_path)
|
||||||
[ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
|
|
||||||
|
|
||||||
# strip the duplicated "/"
|
|
||||||
_save_path=$(echo $_save_path | tr -s /)
|
|
||||||
|
|
||||||
_mntpoint=$(get_mntpoint_from_path $_save_path)
|
_mntpoint=$(get_mntpoint_from_path $_save_path)
|
||||||
_target=$(get_target_from_path $_save_path)
|
_target=$(get_target_from_path $_save_path)
|
||||||
|
|
||||||
@ -472,13 +467,9 @@ default_dump_target_install_conf()
|
|||||||
adjust_bind_mount_path()
|
adjust_bind_mount_path()
|
||||||
{
|
{
|
||||||
local _target=$1
|
local _target=$1
|
||||||
local _save_path=$(get_option_value "path")
|
local _save_path=$(get_save_path)
|
||||||
[ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
|
|
||||||
|
|
||||||
# strip the duplicated "/"
|
|
||||||
_save_path=$(echo $_save_path | tr -s /)
|
|
||||||
|
|
||||||
local _absolute_save_path=$(get_mntpoint_from_target $_target)/$_save_path
|
local _absolute_save_path=$(get_mntpoint_from_target $_target)/$_save_path
|
||||||
|
|
||||||
_absolute_save_path=$(echo "$_absolute_save_path" | tr -s /)
|
_absolute_save_path=$(echo "$_absolute_save_path" | tr -s /)
|
||||||
local _mntpoint=$(get_mntpoint_from_path $_absolute_save_path)
|
local _mntpoint=$(get_mntpoint_from_path $_absolute_save_path)
|
||||||
|
|
||||||
|
@ -126,12 +126,11 @@ get_root_fs_device()
|
|||||||
|
|
||||||
get_save_path()
|
get_save_path()
|
||||||
{
|
{
|
||||||
local _save_path=$(grep "^path" /etc/kdump.conf|awk '{print $2}')
|
local _save_path=$(grep "^path" /etc/kdump.conf|awk '{print $2}')
|
||||||
if [ -z "$_save_path" ]; then
|
[ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
|
||||||
_save_path=$DEFAULT_PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo $_save_path
|
# strip the duplicated "/"
|
||||||
|
echo $(echo $_save_path | tr -s /)
|
||||||
}
|
}
|
||||||
|
|
||||||
get_block_dump_target()
|
get_block_dump_target()
|
||||||
|
Loading…
Reference in New Issue
Block a user