@@ -140,7 +140,7 @@ def create_changeset(
140
140
"ChangeSetType" : changeset_type ,
141
141
"Parameters" : parameter_values ,
142
142
"Capabilities" : capabilities ,
143
- "Description" : "Created by SAM CLI at {0} UTC" . format ( datetime .utcnow ().isoformat ()) ,
143
+ "Description" : f "Created by SAM CLI at { datetime .utcnow ().isoformat ()} UTC" ,
144
144
"Tags" : tags ,
145
145
}
146
146
@@ -172,7 +172,7 @@ def _create_change_set(self, stack_name, changeset_type, **kwargs):
172
172
except botocore .exceptions .ClientError as ex :
173
173
if "The bucket you are attempting to access must be addressed using the specified endpoint" in str (ex ):
174
174
raise deploy_exceptions .DeployBucketInDifferentRegionError (
175
- "Failed to create/update stack {}" . format ( stack_name )
175
+ f "Failed to create/update stack { stack_name } "
176
176
)
177
177
raise deploy_exceptions .ChangeSetError (stack_name = stack_name , msg = str (ex ))
178
178
@@ -278,7 +278,7 @@ def wait_for_changeset(self, changeset_id, stack_name):
278
278
raise deploy_exceptions .ChangeEmptyError (stack_name = stack_name )
279
279
280
280
raise deploy_exceptions .ChangeSetError (
281
- stack_name = stack_name , msg = "ex: {0 } Status: {1 }. Reason: {2}" . format ( ex , status , reason )
281
+ stack_name = stack_name , msg = f "ex: { ex } Status: { status } . Reason: { reason } "
282
282
)
283
283
284
284
def execute_changeset (self , changeset_id , stack_name ):
@@ -323,7 +323,7 @@ def wait_for_execute(self, stack_name, changeset_type):
323
323
elif changeset_type == "UPDATE" :
324
324
waiter = self ._client .get_waiter ("stack_update_complete" )
325
325
else :
326
- raise RuntimeError ("Invalid changeset type {0}" . format ( changeset_type ) )
326
+ raise RuntimeError (f "Invalid changeset type { changeset_type } " )
327
327
328
328
# Poll every 30 seconds. Polling too frequently risks hitting rate limits
329
329
# on CloudFormation's DescribeStacks API
@@ -408,7 +408,7 @@ def get_stack_outputs(self, stack_name, echo=True):
408
408
try :
409
409
outputs = stacks_description ["Stacks" ][0 ]["Outputs" ]
410
410
if echo :
411
- sys .stdout .write ("\n Stack {stack_name} outputs:\n " . format ( stack_name = stack_name ) )
411
+ sys .stdout .write (f "\n Stack { stack_name } outputs:\n " )
412
412
sys .stdout .flush ()
413
413
self ._display_stack_outputs (stack_outputs = outputs )
414
414
return outputs
0 commit comments