-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Description
Here is a simple reproducer:
def foo(record, extras, ignore_keys):
return {'foo': 1}
site_configuration = {
'logging': [
{
'handlers_perflog': [
{
'type': 'httpjson',
'url': 'https://elastic-endpoint',
'level': 'info',
'debug': True,
'json_formatter': foo
}
]
}
]
}Running reframe -C myconf.py --show-config or anything that includes the handlers_perflog yields the following error:
Traceback (most recent call last):
File "/Users/karakasv/Repositories/reframe/./bin/reframe", line 22, in <module>
cli.main()
File "/Users/karakasv/Repositories/reframe/reframe/core/logging.py", line 969, in _fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/karakasv/Repositories/reframe/reframe/frontend/cli.py", line 823, in main
printer.info(str(rt.site_config))
^^^^^^^^^^^^^^^^^^^
File "/Users/karakasv/Repositories/reframe/reframe/core/config.py", line 228, in __str__
return json.dumps(self._pick_config(), indent=2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/__init__.py", line 238, in dumps
**kw).encode(obj)
^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 202, in encode
chunks = list(chunks)
^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 432, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
yield from chunks
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 326, in _iterencode_list
yield from chunks
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
yield from chunks
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 326, in _iterencode_list
yield from chunks
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
yield from chunks
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 439, in _iterencode
o = _default(o)
^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type function is not JSON serializableIf you instead try reframe -C myconf.py --show-config=systems, it works as expected:
[
{
"name": "generic",
"descr": "Generic example system",
"hostnames": [
".*"
],
"partitions": [
{
"name": "default",
"scheduler": "local",
"launcher": "local",
"environs": [
"builtin"
]
}
]
}
]Metadata
Metadata
Assignees
Type
Projects
Status
Done