diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-05 03:14:17 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-05 03:14:17 +0000 |
commit | 81e7cd9b45883ec5a4c971b33aefcf15a6d427bd (patch) | |
tree | f7e0a8142a11924708c6df1a071253c56d5f8cb1 /hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch | |
parent | 0fa696bda0f73911bdc7b68578708331301a4d5e (diff) |
automatic import of hyperv-daemonsopeneuler24.03_LTS
Diffstat (limited to 'hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch')
-rw-r--r-- | hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch b/hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch new file mode 100644 index 0000000..049dc16 --- /dev/null +++ b/hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch @@ -0,0 +1,38 @@ +From ac2132ceaeb611c89eacb468a66f1815ee6fe806 Mon Sep 17 00:00:00 2001 +From: Till Maas <timaas@redhat.com> +Date: Mon, 13 Dec 2021 16:08:42 +0000 +Subject: [PATCH 1/2] hv_set_ifconfig.sh: Use nmcli commands + +RH-Author: Till Maas <None> +RH-MergeRequest: 2: hv_set_ifconfig.sh: Use nmcli commands +RH-Commit: [1/2] fbb64255b1d96babd362391d53529cef0e449296 (timaas/hyperv-daemons) +RH-Bugzilla: 2026371 +RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com> +RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com> + +Instead of using deprecated ifup/ifdown commands, use nmcli commands. +Taking the connection down is not necessary with NM, so don't do it. + +Resolves: #2026371 +--- + hv_set_ifconfig.sh | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/hv_set_ifconfig.sh b/hv_set_ifconfig.sh +index 3dd064c..5a64efe 100644 +--- a/hv_set_ifconfig.sh ++++ b/hv_set_ifconfig.sh +@@ -57,8 +57,5 @@ echo "ONBOOT=yes" >> $1 + + cp $1 /etc/sysconfig/network-scripts/ + +- +-interface=$(echo $1 | awk -F - '{ print $2 }') +- +-/sbin/ifdown $interface 2>/dev/null +-/sbin/ifup $interface 2>/dev/null ++nmcli connection load "/etc/sysconfig/network-scripts/$1" ++nmcli connection up filename "/etc/sysconfig/network-scripts/$1" +-- +2.27.0 + |