Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from sHorst/master
Browse files Browse the repository at this point in the history
added attr to ignore ssl errors
  • Loading branch information
trehn authored Mar 12, 2019
2 parents 397121d + 205e5c4 commit 3e2b686
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"item_download": {
"checksum": "55d04889a77dff6d9b96a5b9f0c7a3a407d2b1be",
"checksum": "367aa0f86cb68d42d77f340da74d803368213f90",
"desc": "Download a file from a webserver and verifies its Hash",
"version": 2
"version": 3
},
"item_git_deploy": {
"checksum": "63ee7962325d88ce8bc056d6bb3fde9ab7104074",
Expand Down
7 changes: 6 additions & 1 deletion item_download/items/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Download(Item):
ITEM_ATTRIBUTES = {
'url': {},
'sha256': {},
'verifySSL': True,
}
ITEM_TYPE_NAME = "download"
REQUIRED_ATTRIBUTES = []
Expand Down Expand Up @@ -50,7 +51,11 @@ def fix(self, status):
pass
else:
# download file
self.node.run("curl -L -s -o {} -- {}".format(quote(self.name), quote(self.attributes.get('url'))))
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.get('url'))
))

# check hash
sha256 = self.__hash_remote_file(self.name)
Expand Down
2 changes: 1 addition & 1 deletion item_download/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"provides": [
"items/download.py"
],
"version": 2
"version": 3
}

0 comments on commit 3e2b686

Please sign in to comment.