Refactor backend code fetching machine information
In #299 (closed) I tried to implement gathering the config file locations of running daemons. Kea provides no command returning config file location, so the only way is to use the current mechanism discovering the processes on the agent. We could return the collection of files with the machine information but there is an issue that from the server standpoint the config file locations are proprietary to daemons, while daemons are initialized later as a result of sending several commands to Kea.
By refactoring, I would like to abstract out the machine information gathered from multiple sources before it is combined into something stored in the database. In addition, the functions in the server/restservice/machine.go
, server/apps/statepuller.go
and server/apps/kea/apkea.go
became already pretty complex and I already had hard time changing anything in them without breaking the functional code. It is the most fragile part of the code and it is already unmaintainable.