blob: 6735eccdb7d11cf9e61e9c6481e15ac65a2c1a83 [file] [log] [blame]
import sys
from services.vnodlocal.models import VnodLocalSystem
from synchronizers.vnodlocal.pseudowireproviders.metronetworkpseudowireprovider import MetronetworkPseudowireProvider
from synchronizers.vnodlocal.pseudowireproviders.segmentroutingvlanxconnectpseudowireprovider import SegmentRoutingVlanXconnectPseudowireProvider
class ProviderFactory(object):
@staticmethod
def getprovider():
# We look up the VnodLocal Configuration to see what to do
vnodlocalsystems = VnodLocalSystem.objects.all()
if not vnodlocalsystems:
return None
vnodlocalsystem = vnodlocalsystems[0]
if vnodlocalsystem.pseudowireprovider == 'metronetwork':
return MetronetworkPseudowireProvider()
elif vnodlocalsystem.pseudowireprovider == 'segmentroutingxconnect':
return SegmentRoutingVlanXconnectPseudowireProvider()
else:
return None