@staticmethod
def add_portrs(xml, ports):
- raise Exception, "not implemented yet"
+ raise Exception("not implemented yet")
if not ports:
return
if not isinstance(ports, list):
@staticmethod
def add_port_attribute(xml, name, value):
- raise Exception, "not implemented yet"
+ raise Exception("not implemented yet")
elem = xml.add_element(name)
elem.set_text(value)
return attribs
@staticmethod
- def get_ports(xml, filter={}):
+ def get_ports(xml, filter=None):
+ if filter is None: filter={}
xpath = './openflow:port | ./port'
port_elems = xml.xpath(xpath)
ports = []