We need to refactor exporting the hosts from the application. Currently the exported data go into a HTTP response, in the near future it’s going to be put on a message queue. The big goal is to have a separate module that handles the serialization. This can be split into rather atomic subtasks:
[ ] Test the current methods of the classes in the app.models module. #325, #329
[x] Move the serialization-related functions to a separate module. #324
[ ] Simplify the functions by moving them out of the classes and renaming them. #326
[ ] Clean up the code inside the functions. #328
All this can be done without touching the logic inside of the methods. Further steps would then be:
[ ] Use the deserialization function to build trusted objects. Concentrate the validation and defaults to a single place. #328
Removed the subtask of using nameduple to internally represent canonical facts. That is currently not possible as the Host model properties are direct database field values. That can be solved as a part of #309.
We need to refactor exporting the hosts from the application. Currently the exported data go into a HTTP response, in the near future it’s going to be put on a message queue. The big goal is to have a separate module that handles the serialization. This can be split into rather atomic subtasks:
All this can be done without touching the logic inside of the methods. Further steps would then be:
The Host class is a DB model. Decoupling the database model from the logic is subject of another task #309.