Metronet Local Service
Change-Id: I92e13f49bbdfc60d27496b3c11207a72310731d4
diff --git a/xos/synchronizer/pseudowireproviders/providerfactory.py b/xos/synchronizer/pseudowireproviders/providerfactory.py
new file mode 100644
index 0000000..6735ecc
--- /dev/null
+++ b/xos/synchronizer/pseudowireproviders/providerfactory.py
@@ -0,0 +1,24 @@
+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
\ No newline at end of file