mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
Make lambda_name abstract property
As we require all instances to have it
This commit is contained in:
committed by
Pea Tyczynska
parent
5a46662c28
commit
1e537d507b
@@ -51,7 +51,10 @@ class CBCProxyClient:
|
|||||||
|
|
||||||
|
|
||||||
class CBCProxyClientBase(ABC):
|
class CBCProxyClientBase(ABC):
|
||||||
lambda_name = None
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def lambda_name(self):
|
||||||
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@@ -101,12 +104,6 @@ class CBCProxyClientBase(ABC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def _invoke_lambda_with_failover(self, payload):
|
def _invoke_lambda_with_failover(self, payload):
|
||||||
if not self.lambda_name:
|
|
||||||
current_app.logger.warning(
|
|
||||||
'{self.__class__.__name__} tried to send {payload} but cbc proxy aws env vars not set'
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
payload_bytes = bytes(json.dumps(payload), encoding='utf8')
|
payload_bytes = bytes(json.dumps(payload), encoding='utf8')
|
||||||
result = self._invoke_lambda(self.lambda_name, payload_bytes)
|
result = self._invoke_lambda(self.lambda_name, payload_bytes)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user