[PATCH 1/2] Move network connection timeout from network to constants
Martin Kolman
mkolman at gmail.com
Thu Mar 21 12:31:29 UTC 2013
Signed-off-by: Martin Kolman <mkolman at gmail.com>
---
pyanaconda/constants.py | 3 +++
pyanaconda/network.py | 6 +++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index faf37e9..87f6daa 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -97,3 +97,6 @@ USETEXT = _("Use text mode")
# Runlevel files
RUNLEVELS = {3: 'multi-user.target', 5: 'graphical.target'}
+
+# Network
+NETWORK_CONNECTION_TIMEOUT = 45 # in seconds
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 1d9ddbf..48cad2b 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -40,6 +40,7 @@ from blivet.devices import FcoeDiskDevice, iScsiDiskDevice
import blivet.arch
from pyanaconda import nm
+from pyanaconda.constants import NETWORK_CONNECTION_TIMEOUT
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -53,7 +54,6 @@ networkConfFile = "%s/network" % (sysconfigDir)
hostnameFile = "/etc/hostname"
ipv6ConfFile = "/etc/sysctl.d/anaconda.conf"
ifcfgLogFile = "/tmp/ifcfg.log"
-CONNECTION_TIMEOUT = 45
DEFAULT_HOSTNAME = "localhost.localdomain"
# part of a valid hostname between two periods (cannot start nor end with '-')
@@ -776,14 +776,14 @@ def wait_for_connecting_NM():
return False
i = 0
- while nm.nm_is_connecting() and i < CONNECTION_TIMEOUT:
+ while nm.nm_is_connecting() and i < NETWORK_CONNECTION_TIMEOUT:
i += 1
time.sleep(1)
if nm.nm_is_connected():
log.debug("connected, waited %d seconds" % i)
return True
- log.debug("not connected, waited %d of %d secs" % (i, CONNECTION_TIMEOUT))
+ log.debug("not connected, waited %d of %d secs" % (i, NETWORK_CONNECTION_TIMEOUT))
return False
def update_hostname_data(ksdata, hostname):
--
1.8.1.4
More information about the anaconda-patches
mailing list