| 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 |