blob: 9ef6cb83f51f7169197cf7cdcc34cb370773ce8e [file] [log] [blame]
Rizwan Haider30b33792016-08-18 02:11:18 -04001import sys
2
3from synchronizers.metronetwork.providers.metronetworktestprovider import MetroNetworkTestProvider
4from synchronizers.metronetwork.providers.metronetworkrestprovider import MetroNetworkRestProvider
5
6
7class ProviderFactory(object):
8 @staticmethod
9 def getprovider(networkdevice):
10
11 undertest = False
12
13 # We either return Test or Rest
14 # By convention a NetworkDevice with name TestDomain will use test objects
15 if networkdevice.id == 'TestMetroNet' or networkdevice.id == 'TestCORD1Net' or networkdevice.id == 'TestCORD2Net':
16 undertest = True
17
18 if undertest:
19 return MetroNetworkTestProvider(networkdevice)
20 else:
21 return MetroNetworkRestProvider(networkdevice)