@@ -27,15 +27,15 @@ class AliasVersionSyncFlow(SyncFlow):
27
27
_lambda_client : Any
28
28
29
29
def __init__ (
30
- self ,
31
- function_identifier : str ,
32
- alias_name : str ,
33
- delete_old_alias : bool ,
34
- build_context : "BuildContext" ,
35
- deploy_context : "DeployContext" ,
36
- sync_context : "SyncContext" ,
37
- physical_id_mapping : Dict [str , str ],
38
- stacks : Optional [List [Stack ]] = None ,
30
+ self ,
31
+ function_identifier : str ,
32
+ alias_name : str ,
33
+ delete_old_alias : bool ,
34
+ build_context : "BuildContext" ,
35
+ deploy_context : "DeployContext" ,
36
+ sync_context : "SyncContext" ,
37
+ physical_id_mapping : Dict [str , str ],
38
+ stacks : Optional [List [Stack ]] = None ,
39
39
):
40
40
"""
41
41
Parameters
@@ -102,9 +102,9 @@ def sync(self) -> None:
102
102
FunctionName = function_physical_id , Name = self ._alias_name , FunctionVersion = version
103
103
)
104
104
if self ._delete_old_alias and current_alias_version :
105
- function_name_w_version = "{}:{}" .format (function_physical_id , current_alias_version )
106
- self . _lambda_client . delete_function ( FunctionName = function_name_w_version )
107
-
105
+ formatted_function_name_version = "{}:{}" .format (function_physical_id , current_alias_version )
106
+ LOG . debug ( "%Deleting Old Version Alias: %s" , self . log_prefix , current_alias_version )
107
+ self . _lambda_client . delete_function ( FunctionName = formatted_function_name_version )
108
108
109
109
def gather_dependencies (self ) -> List [SyncFlow ]:
110
110
return []
@@ -119,7 +119,7 @@ def _equality_keys(self) -> Any:
119
119
def _get_version_alias_if_exists (self ) -> Optional [str ]:
120
120
try :
121
121
return str (self ._lambda_client .get_alias (FunctionName = self .get_physical_id (self ._function_identifier ),
122
- Name = self ._alias_name )
123
- .get ("FunctionVersion" ))
122
+ Name = self ._alias_name )
123
+ .get ("FunctionVersion" ))
124
124
except self ._lambda_client .exceptions .ResourceNotFoundException :
125
- return None
125
+ return None
0 commit comments