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

Commit

Permalink
rauc_dbus_ddi_client: add support for step_callback
Browse files Browse the repository at this point in the history
This function will be called with RAUC progress update information

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
  • Loading branch information
ejoerns committed Oct 30, 2017
1 parent 664cc23 commit 81ed66e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rauc_hawkbit/rauc_dbus_ddi_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RaucDBUSDDIClient(AsyncDBUSClient):
interface.
"""
def __init__(self, session, host, ssl, tenant_id, target_name, auth_token,
attributes, bundle_dl_location, result_callback, lock_keeper=None):
attributes, bundle_dl_location, result_callback, step_callback=None, lock_keeper=None):
super(RaucDBUSDDIClient, self).__init__()

self.attributes = attributes
Expand All @@ -41,6 +41,7 @@ def __init__(self, session, host, ssl, tenant_id, target_name, auth_token,
self.bundle_dl_location = bundle_dl_location
self.lock_keeper = lock_keeper
self.result_callback = result_callback
self.step_callback = step_callback

# DBUS proxy
self.rauc = self.new_proxy('de.pengutronix.rauc.Installer', '/')
Expand Down Expand Up @@ -96,6 +97,9 @@ async def progress_callback(self, connection, sender_name,
self.logger.info('Update progress: {}% {}'.format(percentage,
description))

if self.step_callback:
self.step_callback(percentage, description)

# send feedback to HawkBit
status_execution = DeploymentStatusExecution.proceeding
status_result = DeploymentStatusResult.none
Expand Down

0 comments on commit 81ed66e

Please sign in to comment.