From 25a8b8cb2995d6ed484a24fe9ba873ff1ba61897 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 23 Aug 2010 10:42:31 -0400 Subject: [PATCH] createnet: Wizard complains about wrong DHCP network when DHCP is turned off Add an extra check to only check the range of the DHCP network if DHCP is enabled. : Enter commit message. Lines beginning with 'HG:' are removed. --- src/virtManager/createnet.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/virtManager/createnet.py b/src/virtManager/createnet.py index cff0df1f..4982fdb7 100644 --- a/src/virtManager/createnet.py +++ b/src/virtManager/createnet.py @@ -397,18 +397,19 @@ class vmmCreateNetwork(gobject.GObject): ip = self.get_config_ip4() start = self.get_config_dhcp_start() end = self.get_config_dhcp_end() + enabled = self.window.get_widget("net-dhcp-enable").get_active() - if start is None: + if enabled and start is None: return self.err.val_err(_("Invalid DHCP Address"), \ _("The DHCP start address could not be understood")) - if end is None: + if enabled and end is None: return self.err.val_err(_("Invalid DHCP Address"), \ _("The DHCP end address could not be understood")) - if not ip.overlaps(start): + if enabled and not ip.overlaps(start): return self.err.val_err(_("Invalid DHCP Address"), \ _("The DHCP start address is not with the network %s") % (str(ip))) - if not ip.overlaps(end): + if enabled and not ip.overlaps(end): return self.err.val_err(_("Invalid DHCP Address"), \ _("The DHCP end address is not with the network %s") % (str(ip))) elif page_num == PAGE_FORWARDING: