Ejemplo n.º 1
0
    def _get_external_port(self, name):
        external_ids = self.db_get_map("Interface", name, "external_ids")
        if external_ids:
            return

        ofport = self.db_get_val("Interface", name, "ofport")
        return VifPort(name, ofport, None, None, self)
Ejemplo n.º 2
0
 def _get_vif_port(self, name):
     external_ids = self.db_get_map("Interface", name, "external_ids")
     if "iface-id" in external_ids and "attached-mac" in external_ids:
         return self._vifport(name, external_ids)
     elif ("xs-vif-uuid" in external_ids
           and "attached-mac" in external_ids):
         # if this is a xenserver and iface-id is not automatically
         # synced to OVS from XAPI, we grab it from XAPI directly
         ofport = self.db_get_val("Interface", name, "ofport")
         iface_id = self.get_xapi_iface_id(external_ids["xs-vif-uuid"])
         return VifPort(name, ofport, iface_id,
                        external_ids["attached-mac"], self)
    def _get_external_port(self, name):
        # exclude vif ports
        external_ids = self.db_get_map("Interface", name, "external_ids")
        if external_ids:
            return

        # exclude tunnel ports
        options = self.db_get_map("Interface", name, "options")
        if "remote_ip" in options:
            return

        ofport = self.get_ofport(name)
        return VifPort(name, ofport, None, None, self)
Ejemplo n.º 4
0
 def _vifport(self, name, external_ids):
     ofport = self.db_get_val("Interface", name, "ofport")
     return VifPort(name, ofport, external_ids["iface-id"],
                    external_ids["attached-mac"], self)