ceph / ceph-medic

find common issues in ceph clusters
MIT License
22 stars 18 forks source link

python3 stat use causes execnet to raise unserializable errors #91

Closed alfredodeza closed 5 years ago

alfredodeza commented 5 years ago

The remote function in ceph-medic which calls out to os.stat produces a result object that has callable methods, which gets included in the report and makes execnet to raise an unserializable error since the output is an actual object. This happens in Python3 only where stat has other object attributes not present in Python2:

for attr in dir(stat_info):
    attr = decoded(attr)
    if not attr.startswith('__'):
        value = decoded(getattr(stat_info, attr))
        metadata[attr] = value

A strict list of attributes needs to be added to prevent this problem