Ejemplo n.º 1
0
def pi_model():
    return models.PhysicalInterfaceModel(
        uuid="pi-1-uuid",
        fabric_uuid="fabric-uuid-1",
        host_name="esxi-1",
        dvs_name="dvs-1",
    )
Ejemplo n.º 2
0
 def _create_pi_models_in_db(self, vnc_pis, host_name, dvs_name):
     pi_models = []
     for vnc_pi in vnc_pis:
         fabric_uuid = self._pr_to_fabric[vnc_pi.parent_uuid]
         pi_model = models.PhysicalInterfaceModel(vnc_pi.uuid, fabric_uuid,
                                                  host_name, dvs_name)
         pi_models.append(pi_model)
     for pi_model in pi_models:
         self._database.add_pi_model(pi_model)
         logger.debug("%s saved into database", pi_model)
Ejemplo n.º 3
0
def test_create_vpg_in_vnc(vpg_model, vpg_service, vnc_api_client, database,
                           fabric):
    pr = vnc_api.PhysicalRouter("qfx-1")
    pi = vnc_api.PhysicalInterface(name="pi-1", parent_obj=pr)
    pi.set_uuid("pi-1-uuid")
    vnc_api_client.read_pi.return_value = pi
    vnc_api_client.read_vpg.return_value = None
    vnc_api_client.read_fabric.return_value = fabric
    pi_model = models.PhysicalInterfaceModel("pi-1-uuid", "fabric-uuid",
                                             "esxi-1", "dvs-1")
    database.add_pi_model(pi_model)
    pi_models = [pi_model]

    vpg_service.create_vpg_in_vnc(vpg_model, pi_models)

    vnc_api_client.create_vpg.assert_called_once()
    vnc_api_client.read_fabric.assert_called_once_with(pi_model.fabric_uuid)
    vnc_api_client.read_pi.assert_called_once_with("pi-1-uuid")
Ejemplo n.º 4
0
def pi_model():
    return models.PhysicalInterfaceModel("pi-1-uuid", "fabric-uuid", "esxi-1",
                                         "dvs-1")