diff --git a/changelog.d/96.added b/changelog.d/96.added new file mode 100644 index 0000000..0bc6658 --- /dev/null +++ b/changelog.d/96.added @@ -0,0 +1 @@ +Allow setting virt-bridge to "none" or empty to disable all network configuration diff --git a/koan/virtinstall.py b/koan/virtinstall.py index efb697f..cd4cef5 100644 --- a/koan/virtinstall.py +++ b/koan/virtinstall.py @@ -146,9 +146,8 @@ def _sanitize_nics(nics, bridge, profile_bridge, network_count): if not bridge: intf_bridge = intf["virt_bridge"] if intf_bridge == "": - if profile_bridge == "": - raise InfoException("virt-bridge setting is not defined in cobbler") - intf_bridge = profile_bridge + if profile_bridge != "": + intf_bridge = profile_bridge else: if bridge.find(",") == -1: @@ -157,7 +156,8 @@ def _sanitize_nics(nics, bridge, profile_bridge, network_count): bridges = bridge.split(",") intf_bridge = bridges[counter] - ret.append((intf_bridge, mac)) + if intf_bridge != "": + ret.append((intf_bridge, mac)) return ret @@ -308,8 +308,9 @@ def build_commandline( bridge = profile_data["virt_bridge"] if bridge == "": - raise InfoException("virt-bridge setting is not defined in cobbler") - nics = [(bridge, None)] + nics = [("none", None)] + else: + nics = [(bridge, None)] kernel = profile_data.get("kernel_local") initrd = profile_data.get("initrd_local") @@ -456,7 +457,10 @@ def build_commandline( cmd += "--disk path=%s,device=floppy " % floppy for bridge, mac in nics: - cmd += "--network bridge=%s" % bridge + if bridge == "none": + cmd += "--network none" + else: + cmd += "--network bridge=%s" % bridge if net_model and not disable_net_model: cmd += ",model=%s" % net_model if mac: