def create_fabric(self):
     try:
         fabric = vnc_api.Fabric(self.fabric_name)
         uuid = self.vnc_lib.fabric_create(fabric)
         return self.vnc_lib.fabric_read(id=uuid)
     except vnc_api.RefsExistError:
         pass
Exemplo n.º 2
0
    def _make_fake_fabric(cls):
        fabric = vnc_api.Fabric('fabric01')
        cls._fabric_uuid = cls._vnc_api.fabric_create(fabric)
        cls._vnc_api.fabric_read(id=cls._fabric_uuid)
        cls._cleanup_fabric_queue.append(('fabric', cls._fabric_uuid))

        for pr_name in cls.FABRIC:
            pr = vnc_api.PhysicalRouter(pr_name)
            pr.set_fabric(fabric)
            pr_uuid = cls._vnc_api.physical_router_create(pr)
            cls._cleanup_fabric_queue.append(('physical_router', pr_uuid))

            for pi_name in cls.FABRIC[pr_name]:
                pi = vnc_api.PhysicalInterface(name=pi_name, parent_obj=pr)
                pi_uuid = cls._vnc_api.physical_interface_create(pi)
                cls._cleanup_fabric_queue.append(
                    ('physical_interface', pi_uuid))
Exemplo n.º 3
0
def fabric_2():
    fabric_2 = vnc_api.Fabric(name="fabric_2")
    fabric_2.set_uuid("fabric-uuid-2")
    return fabric_2
Exemplo n.º 4
0
def fabric_1():
    fabric_1 = vnc_api.Fabric(name="fabric_1")
    fabric_1.set_uuid("fabric-uuid-1")
    return fabric_1
Exemplo n.º 5
0
def fabric():
    fabric = vnc_api.Fabric("fabric-name")
    fabric.set_uuid("fabric-uuid-1")
    return fabric