-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Describe the bug
DeviceInitCheckApi does not verify device hostname and causes psycopg2.errors.UniqueViolation if a device is initialized with an already used hostname.
To Reproduce
Steps to reproduce the behavior:
- Init a device with a hostname that is already used by another device.
Expected behavior
Initcheck should verify hostname and return an error if it is a duplicate or not validated.
Outputs
Exception message: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "device_hostname_key"
DETAIL: Key (hostname)=(xxx-xx-xx01-a1) already exists.
[SQL: UPDATE device SET hostname=%(hostname)s WHERE device.id = %(device_id)s]
[parameters:
{'hostname': 'xxx-xx-xx01-a1',
'device_id': 20}
] (Background on this error at: https://sqlalche.me/e/20/gkpj)
Environment:
- Setup Sunet CNaaS
- Version 1.7.0b1
- Client webui
Metadata
Metadata
Assignees
Labels
No labels