[PATCH 2/4 rhel7-branch] Catch no-hwaddr exception only for the respective call (#999514)

Radek Vykydal rvykydal at redhat.com
Mon Aug 26 10:47:15 UTC 2013


Don't catch all ValueErrors of _settings_for_hwaddr call.

Follow-up of commit 03157477b61d81be870b8af22ba58d11672d12ff
---
 pyanaconda/nm.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/nm.py b/pyanaconda/nm.py
index 18a29e7..a434faf 100644
--- a/pyanaconda/nm.py
+++ b/pyanaconda/nm.py
@@ -305,9 +305,10 @@ def _device_settings(name):
     else:
         try:
             hwaddr_str = nm_device_hwaddress(name)
-            settings = _settings_for_hwaddr(hwaddr_str)
-        except ValueError:
+        except PropertyNotFoundError:
             settings = None
+        else:
+            settings = _settings_for_hwaddr(hwaddr_str)
 
     return settings
 
-- 
1.7.11.7



More information about the anaconda-patches mailing list