Skip to content

Load error if a bot has not optional parameters field in runtime configuration #237

@ghost

Description

If a bot has no parameters, like:

...
    "bot-id": {
        "name": "foobar bot",
        "group": "Expert",
        "module": "intelmq.bots.experts.foobar",
        "description": "Foobar descr",
        "enabled": "true"
    }
...

a user gets this error:
image

(Which also points the user to the completely wrong direction)
I suspect that the code which needs to be adapted is here:

app.bots[bot_group][bot_name] = {
'name': bot_name,
'group': bot_group,
'module': bot['module'],
'description': bot['description'],
'enabled': true,
'parameters': bot['parameters'],
'run_mode': 'continuous'
};
for (let parameter in bot['parameters']) {
var value = bot['parameters'][parameter];
app.bots[bot_group][bot_name]['parameters'][parameter] = value;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions