Blame SOURCES/hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch

86bc6d
From 2db75ec41c2e346af992f9c00f2e90ed9fec694b Mon Sep 17 00:00:00 2001
86bc6d
From: Till Maas <timaas@redhat.com>
86bc6d
Date: Mon, 13 Dec 2021 16:08:42 +0000
86bc6d
Subject: [PATCH 1/2] hv_set_ifconfig.sh: Use nmcli commands
86bc6d
86bc6d
RH-Author: Mohamed Gamal Morsy <mmorsy@redhat.com>
86bc6d
RH-MergeRequest: 2: hv_set_ifconfig.sh: Use nmcli commands
86bc6d
RH-Commit: [1/2] c045f4c849a7d8841c8ad4b6e4ba63abfb946187
86bc6d
RH-Bugzilla: 2056566
86bc6d
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
86bc6d
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
86bc6d
86bc6d
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2056566
86bc6d
86bc6d
Instead of using deprecated ifup/ifdown commands, use nmcli commands.
86bc6d
Taking the connection down is not necessary with NM, so don't do it.
86bc6d
86bc6d
Signed-off-by: Till Maas <tmaas@redhat.com>
86bc6d
Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
86bc6d
---
86bc6d
 hv_set_ifconfig.sh | 7 ++-----
86bc6d
 1 file changed, 2 insertions(+), 5 deletions(-)
86bc6d
86bc6d
diff --git a/hv_set_ifconfig.sh b/hv_set_ifconfig.sh
86bc6d
index 3dd064c..5a64efe 100644
86bc6d
--- a/hv_set_ifconfig.sh
86bc6d
+++ b/hv_set_ifconfig.sh
86bc6d
@@ -57,8 +57,5 @@ echo "ONBOOT=yes" >> $1
86bc6d
 
86bc6d
 cp $1 /etc/sysconfig/network-scripts/
86bc6d
 
86bc6d
-
86bc6d
-interface=$(echo $1 | awk -F - '{ print $2 }')
86bc6d
-
86bc6d
-/sbin/ifdown $interface 2>/dev/null
86bc6d
-/sbin/ifup $interface 2>/dev/null
86bc6d
+nmcli connection load "/etc/sysconfig/network-scripts/$1"
86bc6d
+nmcli connection up filename "/etc/sysconfig/network-scripts/$1"
86bc6d
-- 
86bc6d
2.27.0
86bc6d