Skip to content

Commit

Permalink
Fix error parsing input bucket name
Browse files Browse the repository at this point in the history
  • Loading branch information
alpegon committed Jul 5, 2019
1 parent 1b4b0ff commit c38d971
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scar/providers/aws/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ def _delete_bucket_notifications(self, function_arn, function_env_vars):
s3_provider_id = _get_storage_provider_id('S3', function_env_vars)
input_bucket_id = f'STORAGE_PATH_INPUT_{s3_provider_id}' if s3_provider_id else ''
if input_bucket_id in function_env_vars:
input_bucket_name = function_env_vars[input_bucket_id]
input_path = function_env_vars[input_bucket_id]
input_bucket_name = input_path.split("/", 1)[0]
self.aws_s3.delete_bucket_notification(input_bucket_name, function_arn)

def _delete_lambda_function(self, function_name):
Expand Down
2 changes: 1 addition & 1 deletion scar/providers/aws/lambdafunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def launch_lambda_instance(self):

def _get_invocation_payload(self):
# Default payload
payload = self.aws.lambdaf.payload if self.aws.lambdaf.payload else {}
payload = self.aws.lambdaf.payload if hasattr(self.aws.lambdaf, 'payload') else {}
if not payload:
# Check for defined run script
if hasattr(self.aws.lambdaf, "run_script"):
Expand Down

0 comments on commit c38d971

Please sign in to comment.