epsagon / clear-lambda-storage

Removes old versions of Lambda functions
https://epsagon.com/blog/how-to-free-aws-lambda-code-storage-codestorageexceeded/
MIT License
166 stars 44 forks source link

'Namespace' object has no attribute 'num_to_keep': AttributeError on lambda function. #8

Closed thanh-nguyen-van closed 4 years ago

thanh-nguyen-van commented 5 years ago

I got this:

'Namespace' object has no attribute 'num_to_keep': AttributeError Traceback (most recent call last): File "/var/task/handler.py", line 6, in clear_lambda_storage remove_old_lambda_versions(Namespace(token_key_id=None, token_secret=None)) File "/var/task/clear_lambda_storage.py", line 107, in remove_old_lambda_versions if args.num_to_keep: AttributeError: 'Namespace' object has no attribute 'num_to_keep'

ranrib commented 4 years ago

Hi @thanh3d, can you please share you cmd command?

thanh-nguyen-van commented 4 years ago

I deployed serverless and tried to test the function on aws .

nabilfreeman commented 4 years ago

I had the same problem, gave up and just integrated it into my CI pipeline instead

nabilfreeman commented 4 years ago

Hey @thanh3d , potential solution for you here #12

jsburckhardt commented 4 years ago

Not sure if this helps. I included the values in the handler. I agree you could integrated in the ci pipeline. remove_old_lambda_versions(Namespace(token_key_id=None, token_secret=None, num_to_keep=2, profile=None))