kdumpctl: drop SSH_KEY_LOCATION variable
The variable is only used for ssh dump targets. Furthermore it is identical to the value stored in ${OPT[sshkey]}. Thus drop SSH_KEY_LOCATION and use ${OPT[sshkey]} instead. Signed-off-by: Philipp Rudo <prudo@redhat.com> Reviewed-by: Tao Liu <ltao@redhat.com> Reviewed-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
parent
0460f0a768
commit
a859abe365
11
kdumpctl
11
kdumpctl
@ -9,7 +9,6 @@ KDUMP_LOG_PATH="/var/log"
|
|||||||
MKDUMPRD="/sbin/mkdumprd -f"
|
MKDUMPRD="/sbin/mkdumprd -f"
|
||||||
MKFADUMPRD="/sbin/mkfadumprd"
|
MKFADUMPRD="/sbin/mkfadumprd"
|
||||||
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
|
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
|
||||||
SSH_KEY_LOCATION=$DEFAULT_SSHKEY
|
|
||||||
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
|
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
|
||||||
DUMP_TARGET=""
|
DUMP_TARGET=""
|
||||||
DEFAULT_INITRD=""
|
DEFAULT_INITRD=""
|
||||||
@ -238,9 +237,10 @@ parse_config()
|
|||||||
derror "Invalid kdump config value for option '$config_opt'"
|
derror "Invalid kdump config value for option '$config_opt'"
|
||||||
return 1
|
return 1
|
||||||
elif [[ -f $config_val ]]; then
|
elif [[ -f $config_val ]]; then
|
||||||
SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
|
config_val=$(/usr/bin/readlink -m "$config_val")
|
||||||
else
|
else
|
||||||
dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
|
dwarn "WARNING: '$config_val' doesn't exist, using default value '$DEFAULT_SSHKEY'"
|
||||||
|
config_val=$DEFAULT_SSHKEY
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
|
path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
|
||||||
@ -262,6 +262,7 @@ parse_config()
|
|||||||
done <<< "$(kdump_read_conf)"
|
done <<< "$(kdump_read_conf)"
|
||||||
|
|
||||||
OPT[path]=${OPT[path]:-$DEFAULT_PATH}
|
OPT[path]=${OPT[path]:-$DEFAULT_PATH}
|
||||||
|
OPT[sshkey]=${OPT[sshkey]:-$DEFAULT_SSHKEY}
|
||||||
|
|
||||||
check_failure_action_config || return 1
|
check_failure_action_config || return 1
|
||||||
check_final_action_config || return 1
|
check_final_action_config || return 1
|
||||||
@ -718,7 +719,7 @@ check_and_wait_network_ready()
|
|||||||
|
|
||||||
start_time=$(date +%s)
|
start_time=$(date +%s)
|
||||||
while true; do
|
while true; do
|
||||||
errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
|
errmsg=$(ssh -i "${OPT[sshkey]}" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
|
||||||
retval=$?
|
retval=$?
|
||||||
|
|
||||||
# ssh exits with the exit status of the remote command or with 255 if an error occurred
|
# ssh exits with the exit status of the remote command or with 255 if an error occurred
|
||||||
@ -766,7 +767,7 @@ propagate_ssh_key()
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local KEYFILE=$SSH_KEY_LOCATION
|
local KEYFILE=${OPT[sshkey]}
|
||||||
|
|
||||||
#Check to see if we already created key, if not, create it.
|
#Check to see if we already created key, if not, create it.
|
||||||
if [[ -f $KEYFILE ]]; then
|
if [[ -f $KEYFILE ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user