check for get() function

This commit is contained in:
Solvik Blum 2019-08-04 19:18:11 +02:00
parent 0e0ceb7811
commit 87939d3e35
No known key found for this signature in database
GPG key ID: CC12B3DC262B6C47

View file

@ -39,4 +39,6 @@ class Datacenter():
raise ImportError("Driver {} doesn't exists".format(self.driver))
def get(self):
if not hasattr(self.driver, 'get'):
raise Exception("Your driver {} doesn't have a get() function, please fix it".format(self.driver))
return getattr(self.driver, 'get')(self.driver_value, DATACENTER_LOCATION_REGEX)