From: Tony Mack <tmack@paris.CS.Princeton.EDU>
Date: Sat, 4 Feb 2012 02:26:15 +0000 (-0500)
Subject: fix pototntial TypeError
X-Git-Tag: merged-in-sfa-2.1-2~11
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=aef835d447ba01dbde23b3470071d1469c26d609;p=sfa.git

fix pototntial TypeError
---

diff --git a/sfa/rspecs/elements/versions/sfav1Node.py b/sfa/rspecs/elements/versions/sfav1Node.py
index fdf1eb2d..f50e6877 100644
--- a/sfa/rspecs/elements/versions/sfav1Node.py
+++ b/sfa/rspecs/elements/versions/sfav1Node.py
@@ -55,8 +55,9 @@ class SFAv1Node:
             if location:
                 node_elem.add_instance('location', location, Location.fields)
 
-            for interface in node.get('interfaces', []):
-                node_elem.add_instance('interface', interface, ['component_id', 'client_id', 'ipv4']) 
+            if isinstance(node.get('interfaces'), list):
+                for interface in node.get('interfaces', []):
+                    node_elem.add_instance('interface', interface, ['component_id', 'client_id', 'ipv4']) 
             
             #if 'bw_unallocated' in node and node['bw_unallocated']:
             #    bw_unallocated = etree.SubElement(node_elem, 'bw_unallocated', units='kbps').text = str(int(node['bw_unallocated'])/1000)