Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract host (de)serialization #323

Open
1 of 7 tasks
Glutexo opened this issue Jul 2, 2019 · 1 comment
Open
1 of 7 tasks

Extract host (de)serialization #323

Glutexo opened this issue Jul 2, 2019 · 1 comment
Assignees

Comments

@Glutexo
Copy link
Collaborator

Glutexo commented Jul 2, 2019

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:

  • Use the deserialization function to build trusted objects. Concentrate the validation and defaults to a single place. Serialization: Host serialization cleanup #328
  • Get rid of the complicated Host class constructor.
  • Use the same schema-based validation for hosts, canonical facts and facts that is used for system profile. Unify the validation.

The Host class is a DB model. Decoupling the database model from the logic is subject of another task #309.

@Glutexo
Copy link
Collaborator Author

Glutexo commented Jul 17, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant