As the subject says, I cannot figure out how to set an item back to the ‘new’ state, as I cannot pass the option to ignore the max retries count when updating the workitem from Python.
I guess this is the method that needs an additional argument. I would make a pull request myself, if I knew where to pass the option…
OpenFlow version: 1.5.1
Using self hosted openflow: openflow.alphatrods.dk
import openiap
import os
import asyncio
async def main():
openflow_url = os.environ.get("openflow_url")
assert openflow_url is not None
wiq = os.environ.get("wiq")
assert wiq is not None
client = openiap.Client(openflow_url)
# Do some login
await client.Signin()
workitem = await client.PopWorkitem(wiq = wiq)
workitem.state = "retry"
workitem.errortype = "application"
await client.UpdateWorkitem(workitem)
# How do I ensure the workitem is now new
# and not failed if, for instance, it is supposed to run at a later time?
# I might want to update nextrun and let it wait a while and then have it run again
asyncio.run(main())