def __flowvisor_fs_to_instance(self, fs_dict): flowspace = FlowSpace() group = Group() for datapath in fs_dict.keys(): dpid = DPID() dpid.datapath = datapath for port in fs_dict[datapath]["ports"]: of_port = Port() of_port.set_num(port) dpid.add_port(of_port) group.add_dpid(dpid) for match in fs_dict[datapath]["matches"]: of_match = Match() if match.has_key("dl_vlan"): of_match.add_dl_vlan(match["dl_vlan"]) group.add_match(of_match) flowspace.set_group(group) return flowspace