mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-30 17:46:38 +00:00
fix 5800 nicextraparams does not overwrite existed ifcfg attribute (#5801)
This commit is contained in:
parent
67e5a95878
commit
19c5ab3f49
@ -573,18 +573,16 @@ function create_persistent_ifcfg {
|
||||
attrs=${attrs}${attrs:+,}"${name}=${value}"
|
||||
i=$((i+1))
|
||||
done
|
||||
|
||||
# record manual and auto attributes first
|
||||
# since input attributes might overwrite them.
|
||||
#
|
||||
# record input attributes later. They will overwrite
|
||||
# record extra attributes later. They will overwrite
|
||||
# previous generated attributes if duplicate.
|
||||
[ -f $fcfg ] && mv -f $fcfg `dirname $fcfg`/.`basename $fcfg`.bak
|
||||
echo "$attrs,$inattrs" \ | $sed -e 's/,/\n/g' | grep -v "^$" \
|
||||
echo "$inattrs,$attrs" \ | $sed -e 's/,/\n/g' | grep -v "^$" \
|
||||
| $sed -e 's/=/="/' -e 's/ *$/"/' \
|
||||
| uniq_per_key -t'=' -k1 >$fcfg
|
||||
local rc=$?
|
||||
|
||||
# log for debug
|
||||
echo "['ifcfg-${ifname}']" >&2
|
||||
cat $fcfg | $sed -e 's/^/ >> /g' | log_lines info
|
||||
|
@ -733,7 +733,7 @@ function parse_nic_extra_params() {
|
||||
do
|
||||
token2="${params_temp[$k]}"
|
||||
array_extra_param_names[$k]=`echo "$token2" | cut -d'=' -f 1`
|
||||
array_extra_param_values[$k]=`echo "$token2" | cut -d'=' -f 2`
|
||||
array_extra_param_values[$k]=`echo "$token2" | cut -d'=' -f 2-`
|
||||
k=$((k+1))
|
||||
done
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user