chaostoolkit / chaostoolkit-lib

The Chaos Toolkit core library
https://chaostoolkit.org/
Apache License 2.0
77 stars 46 forks source link

Invalid name reported in logs on Python provider validation #223

Closed Lawouach closed 3 years ago

Lawouach commented 3 years ago

Describe the bug

Say you have the following probe:

 invalid_python_func_probe = {
        "name": "hello",
        "type": "probe",
        "provider": {
            "type": "python",
            "module": "os",
            "func": "whatever"
        }
    }

It's invalid becauset he whatever function does not exist in the module os.

Upon failing, CTK reports an invalid name in the logs:

'os' does not expose 'whatever' in activity 'getrandom'

The reason is simple, we override the name variable during the course of the validation function and therefore log the wrong value.