From: Ondrej Lichtner olichtne@redhat.com
This patch fixes the behaviour of the normalize_hwaddr function when nonstring parameter was passed. The function will nor return an empty string in such cases.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Common/NetUtils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lnst/Common/NetUtils.py b/lnst/Common/NetUtils.py index 9563b3c..a578fb7 100644 --- a/lnst/Common/NetUtils.py +++ b/lnst/Common/NetUtils.py @@ -29,7 +29,10 @@ except ImportError: from pyroute2.netlink.rtnl.ifinfmsg import ifinfmsg
def normalize_hwaddr(hwaddr): - return hwaddr.upper().rstrip("\n") + try: + return hwaddr.upper().rstrip("\n") + except: + return ""
def scan_netdevs(): scan = []
Fri, Oct 31, 2014 at 08:58:10AM CET, olichtne@redhat.com wrote:
From: Ondrej Lichtner olichtne@redhat.com
This patch fixes the behaviour of the normalize_hwaddr function when nonstring parameter was passed. The function will nor return an empty string in such cases.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com
applied, thanks.
lnst-developers@lists.fedorahosted.org