Skip to content

Commit 670a789

Browse files
author
Germano Fronza
committed
Fix timeout argument type
1 parent 8b6a88f commit 670a789

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ecs_deploy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _run_parser(self):
188188
sys.exit(1)
189189

190190
# loop for desired timeout
191-
timeout = self.args.get('timeout') or 90
191+
timeout = self.int_or_none(self.args.get('timeout')) or 90
192192
started_at = time.time()
193193
while True:
194194
self.running_tasks = self.client_fn('list_tasks')['taskArns']
@@ -213,6 +213,11 @@ def _run_parser(self):
213213
else:
214214
sys.exit(1)
215215

216+
def _int_or_none(self, value):
217+
if type(value) == str and value.isdigit():
218+
return int(value)
219+
return None
220+
216221
def _task_definition_name(self):
217222
if self.args.get('task_definition'):
218223
return self.args.get('task_definition')

0 commit comments

Comments
 (0)