ofelia rspecs: default parameter for filter is None
Loic Baron [Thu, 31 Jul 2014 09:41:39 +0000 (11:41 +0200)]
sfa/rspecs/elements/versions/ofeliav1datapath.py
sfa/rspecs/elements/versions/ofeliav1link.py

index a184973..01390c0 100644 (file)
@@ -22,7 +22,7 @@ class Ofeliav1Datapath:
 
     @staticmethod
     def get_datapaths(xml, filter=None):
-        if filter is None: filter={}
+        if filter is None: filter = {}
         #xpath = '//datapath%s | //default:datapath%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))
         xpath = '//datapath%s | //openflow:datapath%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))
         datapath_elems = xml.xpath(xpath)
@@ -145,8 +145,7 @@ class Ofeliav1Datapath:
 #                    node.element.remove(sliver.element)
 #        
 #    @staticmethod
-#    def get_nodes(xml, filter=None):
-#        if filter is None: filter={}
+#    def get_nodes(xml, filter={}):
 #        xpath = '//node%s | //default:node%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))
 #        node_elems = xml.xpath(xpath)
 #        return SFAv1Node.get_node_objs(node_elems)
index 83a2096..3a32f21 100644 (file)
@@ -9,7 +9,7 @@ class Ofeliav1Link:
 
     @staticmethod
     def get_links(xml, filter=None):
-        if filter is None: filter={}
+        if filter is None: filter = {}
         xpath = '//link%s | //openflow:link%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))
         link_elems = xml.xpath(xpath)
         return Ofeliav1Link.get_link_objs(link_elems)