fix: remove obsolete attributes from config.json

changes:
- removed unused attributes from config.json
This commit is contained in:
2020-09-07 19:12:30 +02:00
parent c279d288b4
commit 7cbd80c726
5 changed files with 18 additions and 234 deletions

View File

@ -30,17 +30,26 @@ func Start(cnf *config.Config, flogger logger.Logger) error {
}
// Add
repoDevice, err := repo.GetDevice(cnf.Device.ID)
repoDevice, err := repo.GetDevice(cnf.DeviceID)
switch {
case err != nil:
return err
case repoDevice == nil:
err = repo.AddDevices(cnf.Device)
hostname, err := os.Hostname()
if err != nil {
return err
}
repoDevice, err = repo.GetDevice(cnf.Device.ID)
err = repo.AddDevices(&types.Device{
ID: cnf.DeviceID,
Name: hostname,
})
if err != nil {
return err
}
repoDevice, err = repo.GetDevice(cnf.DeviceID)
if err != nil {
return err
}