From 672660d1313f31c1204ca1bd2634ca128cce2a12 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 3 Oct 2020 16:33:41 +0200 Subject: [PATCH] items/download: wrap node.run() in try..except to avoid killing the whole apply --- items/download.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/items/download.py b/items/download.py index d87fdf9..a313acf 100644 --- a/items/download.py +++ b/items/download.py @@ -53,11 +53,14 @@ class Download(Item): pass else: # download file - self.node.run("curl -L {verify}-s -o {file} -- {url}".format( - verify="" if self.attributes.get('verifySSL', True) else "-k ", - file=quote(self.name), - url=quote(self.attributes['url']) - )) + try: + self.node.run("curl -L {verify}-s -o {file} -- {url}".format( + verify="" if self.attributes.get('verifySSL', True) else "-k ", + file=quote(self.name), + url=quote(self.attributes['url']) + )) + except: + return False # check hash sha256 = self.__hash_remote_file(self.name)