Skip to content
This repository has been archived by the owner on Sep 30, 2022. It is now read-only.

Commit

Permalink
Prefer https [download] over http [download-http]
Browse files Browse the repository at this point in the history
Signed-off-by: Livio Bieri <livioso@users.noreply.github.com>
  • Loading branch information
livioso authored and ejoerns committed May 24, 2018
1 parent b3457ae commit 7abb898
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rauc_hawkbit/rauc_dbus_ddi_client.py
Expand Up @@ -213,8 +213,15 @@ async def process_deployment(self, base):
await self.ddi.deploymentBase[action_id].feedback(
status_execution, status_result, [msg])
raise APIError(msg)

# prefer https ('download') over http ('download-http')
# HawkBit provides either only https, only http or both
if 'download' in artifact['_links']:
download_url = artifact['_links']['download']['href']
else:
download_url = artifact['_links']['download-http']['href']

# download artifact, check md5 and report feedback
download_url = artifact['_links']['download-http']['href']
md5_hash = artifact['hashes']['md5']
self.logger.info('Starting bundle download')
await self.download_artifact(action_id, download_url, md5_hash)
Expand Down

0 comments on commit 7abb898

Please sign in to comment.