@@ -103,6 +103,7 @@ def deploy(src, requirements=False, local_package=None):
103103 else :
104104 create_function (cfg , path_to_zip_file )
105105
106+
106107def deploy_s3 (src , requirements = False , local_package = None ):
107108 """Deploys a new function via AWS S3.
108109
@@ -130,6 +131,7 @@ def deploy_s3(src, requirements=False, local_package=None):
130131 else :
131132 create_function (cfg , path_to_zip_file , use_s3 , s3_file )
132133
134+
133135def upload (src , requirements = False , local_package = None ):
134136 """Uploads a new function to AWS S3.
135137
@@ -462,20 +464,20 @@ def create_function(cfg, path_to_zip_file, *use_s3, **s3_file):
462464 )
463465 print ('Creating lambda function with name: {}' .format (func_name ))
464466
465- if use_s3 == True :
467+ if use_s3 :
466468 kwargs = {
467469 'FunctionName' : func_name ,
468470 'Runtime' : cfg .get ('runtime' , 'python2.7' ),
469471 'Role' : role ,
470472 'Handler' : cfg .get ('handler' ),
471473 'Code' : {
472474 'S3Bucket' : '{}' .format (buck_name ),
473- 'S3Key' : '{}' .format (s3_file )
475+ 'S3Key' : '{}' .format (s3_file ),
474476 },
475477 'Description' : cfg .get ('description' ),
476478 'Timeout' : cfg .get ('timeout' , 15 ),
477479 'MemorySize' : cfg .get ('memory_size' , 512 ),
478- 'Publish' : True
480+ 'Publish' : True ,
479481 }
480482 else :
481483 kwargs = {
@@ -487,7 +489,7 @@ def create_function(cfg, path_to_zip_file, *use_s3, **s3_file):
487489 'Description' : cfg .get ('description' ),
488490 'Timeout' : cfg .get ('timeout' , 15 ),
489491 'MemorySize' : cfg .get ('memory_size' , 512 ),
490- 'Publish' : True
492+ 'Publish' : True ,
491493 }
492494
493495 if 'environment_variables' in cfg :
@@ -528,18 +530,18 @@ def update_function(cfg, path_to_zip_file, *use_s3, **s3_file):
528530 os .environ .get ('S3_BUCKET_NAME' ) or cfg .get ('bucket_name' )
529531 )
530532
531- if use_s3 == True :
533+ if use_s3 :
532534 client .update_function_code (
533535 FunctionName = cfg .get ('function_name' ),
534536 S3Bucket = '{}' .format (buck_name ),
535537 S3Key = '{}' .format (s3_file ),
536- Publish = True
538+ Publish = True ,
537539 )
538540 else :
539541 client .update_function_code (
540542 FunctionName = cfg .get ('function_name' ),
541543 ZipFile = byte_stream ,
542- Publish = True
544+ Publish = True ,
543545 )
544546
545547 kwargs = {
@@ -569,6 +571,7 @@ def update_function(cfg, path_to_zip_file, *use_s3, **s3_file):
569571
570572 client .update_function_configuration (** kwargs )
571573
574+
572575def upload_s3 (cfg , path_to_zip_file , * use_s3 ):
573576 """Upload a function to AWS S3."""
574577
@@ -604,7 +607,7 @@ def upload_s3(cfg, path_to_zip_file, *use_s3):
604607
605608 client .put_object (** kwargs )
606609 print ('Finished uploading {} to S3 bucket {}' .format (func_name , buck_name ))
607- if use_s3 == True :
610+ if use_s3 :
608611 return filename
609612
610613
0 commit comments