IBM Security Resilient

Expand all | Collapse all

Error with workflow.addProperty and Python3

  • 1.  Error with workflow.addProperty and Python3

    Posted 10 days ago

    Hey everyone,

    I'm experiencing an error when trying to run a Python 3 script within Resilient that contains the following line:

    workflow.addProperty("data", {"key": [1,2,3]})

    I get the error "Script 'data setter' from Workflow 'Workflow Property test' was unable to complete because: TypeError: 'NoneType' object is not callable".

    If I change the language of the script to Python 2, it works fine. Also worth noting that if I change the value from a list to a string as a Python 3 script, it works fine. So it seems there's an issue while trying to add a dictionary that contains a list to the workflow properties in Python 3.

    Note: I also tried creating the dictionary outside of the `workflow.addProperty()` call, e.g.:

    x = {"key": [1,2,3]}

    workflow.addProperty("data", x)

    and this didn't work either.

    Any ideas if I could be doing something wrong, or is this a bug? I can provide more details about my script / workflow / rule I was using to replicate the issue.



    ------------------------------
    Liam Mahoney
    ------------------------------


  • 2.  RE: Error with workflow.addProperty and Python3

    Posted 9 days ago
    Edited by BENOIT ROSTAGNI 9 days ago
    Hi Liam,

    Just tested on v39

    thisdict = {
    "brand": "Ford",
    "model": "Mustang",
    "year": 1964
    }
    workflow.addProperty("detail", thisdict)
    do work

    workflow.addProperty("detail", {"key": [1,2,3]})
    do not work
    ------------------------------
    BENOIT ROSTAGNI
    ------------------------------



  • 3.  RE: Error with workflow.addProperty and Python3

    Posted 7 days ago
    Hi Liam,

    This is a bug with adding lists and nested dictionaries to workflow properties in Python 3. We are currently working on a fix targeted for V39.1 so until then you will have to use Python 2 for this particular script. I will reply to this thread when the fix is confirmed.

    Thanks,

    ------------------------------
    Sean Mc Cann
    ------------------------------



  • 4.  RE: Error with workflow.addProperty and Python3

    Posted 7 days ago
    @BENOIT ROSTAGNI @Sean Mc Cann thanks for the update!​​

    ------------------------------
    Liam Mahoney
    ------------------------------