praiskup / resalloc

Allocator and manager for (expensive) resources
GNU General Public License v2.0
7 stars 7 forks source link

Fix resoure-info traceback for STARTING resources #80

Closed FrostyX closed 2 years ago

FrostyX commented 2 years ago

The STARTING resources doesn't have any data:

Traceback (most recent call last):
File "/usr/bin/resalloc-maint", line 114, in <module>
    sys.exit(main())
File "/usr/bin/resalloc-maint", line 95, in main
    maint.resource_info(args.resource)
File "/usr/lib/python3.10/site-packages/resallocserver/maint.py", line 64, in resource_info
    print(json.dumps(resource.to_dict(), indent=4))
File "/usr/lib/python3.10/site-packages/resallocserver/models.py", line 103, in to_dict
    result["data"] = result["data"].decode("utf8").strip()
AttributeError: 'NoneType' object has no attribute 'decode'
praiskup commented 2 years ago

Thanks! And sorry for the delay, this has fallen off the radar.