#5884: don't crash on non-ascii characters in essids.
This commit is contained in:
parent
83353f3c72
commit
74e0041c03
@ -394,15 +394,13 @@ class NMInfo(object):
|
|||||||
config.read(self._cfg_file)
|
config.read(self._cfg_file)
|
||||||
networks = {}
|
networks = {}
|
||||||
for name in config.sections():
|
for name in config.sections():
|
||||||
if not isinstance(name, unicode):
|
|
||||||
name = unicode(name)
|
|
||||||
net = Network(name)
|
|
||||||
try:
|
try:
|
||||||
|
net = Network(name)
|
||||||
net.read_from_config(config)
|
net.read_from_config(config)
|
||||||
networks[name] = net
|
networks[name] = net
|
||||||
except NetworkInvalidError, e:
|
except Exception, e:
|
||||||
logging.debug("Error: invalid stored network config: %s" % e)
|
logging.error("Error when processing config for the network %s: %r" % (name, e))
|
||||||
del net
|
|
||||||
del config
|
del config
|
||||||
return networks
|
return networks
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user