virt-manager/5573aeb4-createnet-Fix-XML-editor-error-when-dhcp-fields-are-empty.patch
Charles Arnold 3dfca40283 - jsc#SLE-11773, Dev: virt-manager: AppIndicator3
virt-manager.spec
- jsc#SLE-15926 - Dev: XEN: drop netware support
  Drop virtman-keycombo.patch

- Upstream bug fix (bsc#1027942)
  e8bf16b9-details-fix-detection-of-firmware-auto-selection.patch
  5573aeb4-createnet-Fix-XML-editor-error-when-dhcp-fields-are-empty.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=505
2020-09-02 20:52:19 +00:00

64 lines
2.5 KiB
Diff

Subject: createnet: Fix XML editor error when dhcp fields are empty
From: Cole Robinson crobinso@redhat.com Wed Jan 29 18:43:58 2020 -0500
Date: Wed Jan 29 18:53:31 2020 -0500:
Git: 5573aeb44100bcabdc24ab1cd19ec96bb4cb9d62
We need to handle the case when ip == None
https://bugzilla.redhat.com/show_bug.cgi?id=1726586
Signed-off-by: Cole Robinson <crobinso@redhat.com>
--- virt-manager-2.2.1.orig/virtManager/createnet.py
+++ virt-manager-2.2.1/virtManager/createnet.py
@@ -414,31 +414,35 @@ class vmmCreateNetwork(vmmGObjectUI):
if self.get_config_ipv4_enable():
ip = self.get_config_ip4()
ipobj = net.ips.add_new()
- ipobj.address = str(ip.network_address + 1)
- ipobj.netmask = str(ip.netmask)
+ if ip:
+ ipobj.address = str(ip.network_address + 1)
+ ipobj.netmask = str(ip.netmask)
if self.get_config_dhcpv4_enable():
dhcpobj = ipobj.ranges.add_new()
- dhcpobj.start = str(
- self.get_config_dhcpv4_start().network_address
- )
- dhcpobj.end = str(self.get_config_dhcpv4_end().network_address)
+ start = self.get_config_dhcpv4_start()
+ end = self.get_config_dhcpv4_end()
+ if start:
+ dhcpobj.start = str(start.network_address)
+ if end:
+ dhcpobj.end = str(end.network_address)
if self.get_config_ipv6_enable():
ip = self.get_config_ip6()
ipobj = net.ips.add_new()
ipobj.family = "ipv6"
- ipobj.address = str(ip.network_address + 1)
- ipobj.prefix = str(ip.prefixlen)
+ if ip:
+ ipobj.address = str(ip.network_address + 1)
+ ipobj.prefix = str(ip.prefixlen)
if self.get_config_dhcpv6_enable():
dhcpobj = ipobj.ranges.add_new()
- dhcpobj.start = str(
- self.get_config_dhcpv6_start().network_address
- )
- dhcpobj.end = str(
- self.get_config_dhcpv6_end().network_address
- )
+ start = self.get_config_dhcpv6_start()
+ end = self.get_config_dhcpv6_end()
+ if start:
+ dhcpobj.start = str(start.network_address)
+ if end:
+ dhcpobj.end = str(end.network_address)
return net