diff --git a/goblet/handlers/pubsub.py b/goblet/handlers/pubsub.py index b38418fa..0ac9a9fe 100644 --- a/goblet/handlers/pubsub.py +++ b/goblet/handlers/pubsub.py @@ -84,7 +84,7 @@ def __call__(self, event, context): # Subscription else: subscription = event.json["subscription"].split("/")[-1] - topic_name = subscription.replace(self.name + "-", "") + topic_name = subscription.replace(self.name + "-", "", 1) data = base64.b64decode(event.json["message"]["data"]).decode("utf-8") attributes = event.json["message"].get("attributes") or {} @@ -145,15 +145,17 @@ def _deploy_subscription(self, topic_name, topic): req_body = { "topic": f"projects/{topic['project']}/topics/{topic_name}", "filter": topic["filter"] or "", - "pushConfig": {} - if topic["config"].get("enableExactlyOnceDelivery", None) - else { - "pushEndpoint": push_url, - "oidcToken": { - "serviceAccountEmail": service_account, - "audience": push_url, - }, - }, + "pushConfig": ( + {} + if topic["config"].get("enableExactlyOnceDelivery", None) + else { + "pushEndpoint": push_url, + "oidcToken": { + "serviceAccountEmail": service_account, + "audience": push_url, + }, + } + ), "labels": self.config.labels, **topic["config"], }