Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package virt-bridge-setup for 
openSUSE:Factory checked in at 2025-05-26 18:33:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/virt-bridge-setup (Old)
 and      /work/SRC/openSUSE:Factory/.virt-bridge-setup.new.2732 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "virt-bridge-setup"

Mon May 26 18:33:50 2025 rev:7 rq:1279501 version:1.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/virt-bridge-setup/virt-bridge-setup.changes      
2025-04-30 19:03:35.588352152 +0200
+++ 
/work/SRC/openSUSE:Factory/.virt-bridge-setup.new.2732/virt-bridge-setup.changes
    2025-05-26 18:35:31.211378670 +0200
@@ -1,0 +2,12 @@
+Tue May 20 13:48:18 UTC 2025 - Antoine Ginies <agin...@suse.com>
+
+- version 1.1:
+  * remove timeout to get IP address, this is adding wrong information
+    and this is not reliable at all, purpose of the tool is to prepare
+    the system not to replace network manager
+  * remove simple option (add too much complexity in this basic tool)
+  * connection name on the Ethernet/wifi interface is using "-brslave"
+    appendix now
+  * Fix issue with master_interface check
+
+-------------------------------------------------------------------

Old:
----
  1.0.tar.gz

New:
----
  1.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ virt-bridge-setup.spec ++++++
--- /var/tmp/diff_new_pack.jSgyZs/_old  2025-05-26 18:35:31.695399074 +0200
+++ /var/tmp/diff_new_pack.jSgyZs/_new  2025-05-26 18:35:31.695399074 +0200
@@ -16,7 +16,7 @@
 #
 
 Name:           virt-bridge-setup
-Version:        1.0
+Version:        1.1
 Release:        1%{?dist}
 Summary:        Script to setup virtual bridges
 License:        GPL-2.0-or-later

++++++ 1.0.tar.gz -> 1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/virt-bridge-setup-1.0/README.md 
new/virt-bridge-setup-1.1/README.md
--- old/virt-bridge-setup-1.0/README.md 2025-04-29 17:44:05.000000000 +0200
+++ new/virt-bridge-setup-1.1/README.md 2025-05-23 11:16:50.000000000 +0200
@@ -3,8 +3,8 @@
 This script allows you to create a network bridge on a specified interface 
using `nmcli`.
 It simplifies the process of creating and managing network bridges for 
virtualization environments.
 This was originally created to replace the automatic "yast2 virtualization" 
bridge creation.
-Support IPV4 only. This is a simple script which doesnt aim to support all 
network scenarios. For
-complex task please setup the bridge manually.
+Support IPV4 only. 
+This is a simple script which doesnt aim to support all network scenarios, for 
complex task please setup the bridge manually. The script should be run just 
after post-install, not after any network customisation.
 
 ## Features
 
@@ -12,8 +12,6 @@
 - Creates a network bridge with the default name `br0`
 - `-f` `--force`: deletes an existing bridge if used
 - `-i` `--interface`: options to select the device
-- `-s` `--simple`: Simple way to create the bridge
-- `-t` `--timeout`: set timeout to get an IP address
 - `--fdelay`: forward-delay option
 - `--stp`: Set Spanning Tree to yes or no
 - `-n` `--norun`: Dry run
@@ -37,7 +35,7 @@
 ## Usage
 
 ```sh
-python virt-bridge-setup.py -i <interface_name> [-f] [-d] [-s] [-t] SECONDS 
[-m] MAC [--fdelay] SECONDS [--stp] (yes|no)
+python virt-bridge-setup.py -i <interface_name> [-f] [-d] [-m] MAC [--fdelay] 
SECONDS [--stp] (yes|no)
 ```
 
 ## Licence
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/virt-bridge-setup-1.0/virt-bridge-setup.changes 
new/virt-bridge-setup-1.1/virt-bridge-setup.changes
--- old/virt-bridge-setup-1.0/virt-bridge-setup.changes 2025-04-29 
17:44:05.000000000 +0200
+++ new/virt-bridge-setup-1.1/virt-bridge-setup.changes 2025-05-23 
11:16:50.000000000 +0200
@@ -1,4 +1,16 @@
 -------------------------------------------------------------------
+Tue May 20 13:48:18 UTC 2025 - Antoine Ginies <agin...@suse.com>
+
+- version 1.1:
+  * remove timeout to get IP address, this is adding wrong information
+    and this is not reliable at all, purpose of the tool is to prepare
+    the system not to replace network manager
+  * remove simple option (add too much complexity in this basic tool)
+  * connection name on the Ethernet/wifi interface is using "-brslave"
+    appendix now
+  * Fix issue with master_interface check
+
+-------------------------------------------------------------------
 Tue Apr 29 15:43:07 UTC 2025 - Antoine Ginies <agin...@suse.com>
 
 - version 1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/virt-bridge-setup-1.0/virt-bridge-setup.py 
new/virt-bridge-setup-1.1/virt-bridge-setup.py
--- old/virt-bridge-setup-1.0/virt-bridge-setup.py      2025-04-29 
17:44:05.000000000 +0200
+++ new/virt-bridge-setup-1.1/virt-bridge-setup.py      2025-05-23 
11:16:50.000000000 +0200
@@ -53,7 +53,7 @@
     stdout, stderr = run_command(cmd)
     return stdout == "active", stdout + "\n" + stderr
 
-def create_bridge(bridge_interface, interface, conn_name, conn_type, simple):
+def create_bridge(bridge_interface, interface, conn_name, conn_type):
     """
     Create a new bridge and on an interface
     """
@@ -63,11 +63,7 @@
     if stderr:
         logging.error(f"Error adding bridge {bridge_interface}: {stderr}")
         return
-    if simple is True:
-        _, stderr = run_command(f"nmcli connection modify '{conn_name}' master 
{bridge_interface}")
-    else:
-        # work around a strange behavior of NetworkManager in SLE16 and TW
-        _, stderr = run_command(f"nmcli connection add type {conn_type} ifname 
{interface} con-name {interface}-slave master {MY_BRIDGE}")
+    _, stderr = run_command(f"nmcli connection add type {conn_type} ifname 
{interface} con-name {interface}-brslave master {MY_BRIDGE}")
     if stderr:
         logging.error(f"Error add type {conn_type} ifname {interface}: 
{stderr}")
         return
@@ -118,42 +114,20 @@
             logging.error(f"Error deleting id {name}: {stderr}")
             return
 
-def bring_bridge_up(bridge_interface, interface, simple, timeout):
+def bring_bridge_up(bridge_interface, interface):
     """
     Bring the bridge up and set it to autoconnect
     """
     logging.info(f"Bringing the bridge {bridge_interface} up, this can take 
some times...")
-    logging.debug(f"Timeout ise set to: {timeout}")
     #_, stderr = run_command(f"nmcli connection modify {MY_BRIDGE} ipv4.method 
auto")
     #if stderr:
     #    logging.error(f"Error modify {MY_BRIDGE} auto method: {stderr}")
     #    return
     run_command(f"nmcli connection modify {MY_BRIDGE} connection.autoconnect 
yes")
-    if simple is False:
-        _, stderr = run_command(f"nmcli connection up {interface}-slave")
-        if not wait_for_ip(bridge_interface, timeout):
-            logging.error(f"Failed to obtain IP address on {bridge_interface}")
-        if stderr:
-            logging.error(f"Error bringing up {bridge_interface}: {stderr}")
-            return
-    else:
-        _, stderr = run_command(f"nmcli connection up {MY_BRIDGE}")
-        if stderr:
-            logging.error(f"Error bringing up {MY_BRIDGE}: {stderr}")
-            return
-
-def wait_for_ip(interface, timeout, interval=2):
-    """
-    Wait for the interface to get an IP address
-    """
-    end_time = time.time() + timeout
-    while time.time() < end_time:
-        stdout, _ = run_command(f"nmcli device show {interface}")
-        if re.search(r'\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b', stdout):
-            logging.info(f"IP address obtained on {interface}: {stdout}")
-            return True
-        time.sleep(interval)
-    return False
+    _, stderr = run_command(f"nmcli connection up {interface}-brslave")
+    if stderr:
+        logging.error(f"Error bringing up {bridge_interface}: {stderr}")
+        return
 
 def get_nmcli_connection_info():
     """
@@ -237,11 +211,9 @@
             will pickup the first wireless one.")
     parser.add_argument('-i', '--interface', type=str, help='Specify the slave 
interface name')
     parser.add_argument('-f', '--force', action='store_true', help='Force 
deleting previous bridge')
-    parser.add_argument('-s', '--simple', action='store_true', help='Simple 
way of creating the bridge')
     parser.add_argument('-m', '--mac', action='store_true', help='Force using 
MAC address from slave interface')
     parser.add_argument('--stp', type=str, help='Set STP to yes or no')
     parser.add_argument('--fdelay', type=int, help='Set forward-delay option 
(in second)')
-    parser.add_argument('-t', '--timeout', type=int, help='Set timeout to get 
IP (default is 15 seconds)')
     parser.add_argument('-n', '--norun', action='store_true', help='Dry run')
     parser.add_argument('-d', '--debug', action='store_true', help='Enable 
debug mode to show all commands executed')
     args = parser.parse_args()
@@ -252,11 +224,6 @@
     else:
         logging.basicConfig(level=logging.INFO, format='%(asctime)s - 
%(levelname)s - %(message)s')
 
-    if args.simple:
-        simple = True
-    else:
-        simple = False
-
     status, output = is_networkmanager_running()
     if status:
         logging.info("NetworkManager is running.")
@@ -288,7 +255,7 @@
 
     if bridge_interface:
         if args.force:
-            delete_bridge(bridge_interface, bridge_name, 
master_interface+"-slave")
+            delete_bridge(bridge_interface, bridge_name, 
master_interface+"-brslave")
         else:
             logging.warning(f"Bridge {bridge_interface} already existing!")
             logging.info("You have 2 options:")
@@ -296,7 +263,7 @@
             logging.info(f"2) use --force to delete {bridge_interface} and 
setup another one")
             exit(1)
 
-    if not master_interface:
+    if master_interface is None:
         logging.error("No Ethernet or WiFi connection found. Adjust your 
network.")
         exit(1)
 
@@ -305,12 +272,9 @@
         exit(1)
 
     if not args.norun:
-        create_bridge(BRIDGE_INTERFACE, master_interface, conn_name, 
conn_type, simple)
+        create_bridge(BRIDGE_INTERFACE, master_interface, conn_name, conn_type)
         if args.mac:
-            if simple is False:
-                force_mac_address(MY_BRIDGE, mac_address)
-            else:
-                logging.info("Can't force MAC address in simple mode")
+            force_mac_address(MY_BRIDGE, mac_address)
         if args.stp:
             if args.stp.lower() not in ['yes', 'no']:
                 logging.error(f"{args.stp} is not yes or no")
@@ -318,12 +282,7 @@
             set_stp(MY_BRIDGE, args.stp.lower())
         if args.fdelay:
             set_fdelay(MY_BRIDGE, args.fdelay)
-        if args.timeout:
-            timeout = args.timeout
-        else:
-            # default timeout is 15 seconds
-            timeout = 15
-        bring_bridge_up(BRIDGE_INTERFACE, master_interface, simple, timeout)
+        bring_bridge_up(BRIDGE_INTERFACE, master_interface)
 
 if __name__ == "__main__":
     main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/virt-bridge-setup-1.0/virt-bridge-setup.spec 
new/virt-bridge-setup-1.1/virt-bridge-setup.spec
--- old/virt-bridge-setup-1.0/virt-bridge-setup.spec    2025-04-29 
17:44:05.000000000 +0200
+++ new/virt-bridge-setup-1.1/virt-bridge-setup.spec    2025-05-23 
11:16:50.000000000 +0200
@@ -16,7 +16,7 @@
 #
 
 Name:           virt-bridge-setup
-Version:        1.0
+Version:        1.1
 Release:        1%{?dist}
 Summary:        Script to setup virtual bridges
 License:        GPL-2.0-or-later
@@ -42,6 +42,7 @@
 %files
 %license LICENSE
 %doc README.md
+%{_sysconfdir}
 %attr(0755,root,root) %{_sbindir}/%{name}
 %attr(0644,root,root) %{_sysconfdir}/systemd/network/98-default-bridge.link
 

Reply via email to