summaryrefslogtreecommitdiffstats
path: root/pyanaconda/network.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyanaconda/network.py')
-rw-r--r--pyanaconda/network.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index f968fba49..1f2bf1961 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -61,19 +61,22 @@ DEFAULT_HOSTNAME = "localhost.localdomain"
# for more info about '(?!-)' and '(?<!-)' see 're' module documentation
HOSTNAME_PART_RE = re.compile("(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
-# Setup special logging for ifcfg NM interface
-from pyanaconda import anaconda_log
-logger = logging.getLogger("ifcfg")
-logger.setLevel(logging.DEBUG)
-anaconda_log.logger.addFileHandler(ifcfgLogFile, logger, logging.DEBUG)
-if os.access("/dev/tty3", os.W_OK):
- anaconda_log.logger.addFileHandler("/dev/tty3", logger,
- anaconda_log.DEFAULT_TTY_LEVEL,
- anaconda_log.TTY_FORMAT,
- autoLevel=True)
-anaconda_log.logger.forwardToSyslog(logger)
-
-ifcfglog = logging.getLogger("ifcfg")
+ifcfglog = None
+def setup_ifcfg_log():
+ # Setup special logging for ifcfg NM interface
+ from pyanaconda import anaconda_log
+ global ifcfglog
+ logger = logging.getLogger("ifcfg")
+ logger.setLevel(logging.DEBUG)
+ anaconda_log.logger.addFileHandler(ifcfgLogFile, logger, logging.DEBUG)
+ if os.access("/dev/tty3", os.W_OK):
+ anaconda_log.logger.addFileHandler("/dev/tty3", logger,
+ anaconda_log.DEFAULT_TTY_LEVEL,
+ anaconda_log.TTY_FORMAT,
+ autoLevel=True)
+ anaconda_log.logger.forwardToSyslog(logger)
+
+ ifcfglog = logging.getLogger("ifcfg")
class IPError(Exception):
pass