From 6aabdf416e3883bd133bf9dd54aaa32778972f12 Mon Sep 17 00:00:00 2001 From: Valeriy Mukhtarulin Date: Sat, 5 Dec 2020 17:37:09 -0300 Subject: [PATCH] Fix when no expressions or keep_warm is false When I set keep_warm_expression it fails with ``` events=events File "/Users/valery/.local/share/virtualenvs/document_data_extract_zappa-j8vc3Vbe/lib/python3.6/site-packages/zappa/core.py", line 2783, in schedule_events print("Could not create event {} - Please define either an expression or an event source".format(name)) UnboundLocalError: local variable 'name' referenced before assignment ``` So I fixed it. --- zappa/core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zappa/core.py b/zappa/core.py index 2798ae786..f85d8a59c 100644 --- a/zappa/core.py +++ b/zappa/core.py @@ -2780,6 +2780,7 @@ def schedule_events(self, lambda_arn, lambda_name, events, default=True): elif rule_response == 'dryrun': print("Dryrun for creating {} event schedule for {}!!".format(svc, function)) else: + name = self.get_scheduled_event_name(event, function, lambda_name) print("Could not create event {} - Please define either an expression or an event source".format(name))