openwisp / django-netjsonconfig

Configuration manager for embedded devices, implemented as a reusable django-app
http://openwisp.org
Other
194 stars 60 forks source link

WIP: [feature] Add support for hardware ID / serial number #95

Closed okraits closed 6 years ago

okraits commented 6 years ago

Closes #86

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.4%) to 99.609% when pulling 67dc66005dcf8945d47c4a9ae86bf18adbecd7b7 on TDT-AG:tdt-hardware-id into e058709a1689b6711a42d89542a5c0b605542905 on openwisp:master.

nemesifier commented 6 years ago

PS: rebase also on the current master when you can

okraits commented 6 years ago

@nemesisdesign I fixed the README.rst and rebased on the current master.

For the __str__ method, do you mean overwriting it in the class https://github.com/openwisp/django-netjsonconfig/blob/master/django_netjsonconfig/models.py#L16? I didn't find a __str__ method where the mac address is used. Is this done automatically?

nemesifier commented 6 years ago

@okraits you're right is not the macaddress that it's used but the name, so if in openwisp-config you're sending the serial number as the default name you'll get the result you want

okraits commented 6 years ago

@nemesisdesign hardware ID/serial number and name are separate fields in openwisp-config: https://github.com/openwisp/openwisp-config/pull/75/commits/3993bc523094a8876c7c0fe7b1e7398c78bf7224#diff-b00d48fc9d162653819b99c7ae0a9f5eR167

I added a test like you said but it fails badly. I don't understand the test. Could you please help me with it?