I am working on a celery software update system. I have a precedent that I am struggling to implement. Here are my assignments:
device_software_updates (device_id)
returns a list of software updates that need to be installed on a device
installed_device_software (device_id)
returns the software modules that are currently installed on a device
latest_device_software (device_id)
returns the latest software versions available for a device
software_updates (installed_software, latest_software)
returns the latest software modules that are not installed
In pure python, the implementation of device_software_updates might look like
def device_software_updates(device_id):
return software_updates(installed_device_software(device_id),
latest_device_software(device_id))
What is the cleanest way to implement this in Celery 3.0? I would like to do something using groups. My current implementation is as follows:
def device_software_updates(device_id):
return (
group(installed_device_software.s(device_id),
latest_device_software.s(device_id)) |
software_updates.s()
)()
Unfortunately, this means that the software_updates argument is software_updates(arg_list)not perfect.
source
share