terraform-provider-unifi icon indicating copy to clipboard operation
terraform-provider-unifi copied to clipboard

Allow device adoption

Open joshuaspence opened this issue 3 years ago • 3 comments

Allow for devices to be adopted on creation and forgotten on destruction. As these could be destructive operations I have made them both opt-in with allow_adopt and forget_on_destroy.

One issue that I haven't fixed is that the acceptance tests fail with TEST_COUNT=2 (or any number larger than one). The reason for this is that after forgetting a device it seems to disappear completely for about 30 seconds before it reappears. I wanted to think about this problem a bit more and will submit a follow-up PR to fix it.

joshuaspence avatar Sep 16 '21 12:09 joshuaspence

Tests should be fixed by #190

joshuaspence avatar Sep 22 '21 07:09 joshuaspence

Needs a bit more work. It looks harmless, but I see some warnings/errors in the controller logs:

[2021-09-26T02:09:48,619] <webapi-243> WARN  sanitize - Invalid key exists in Device payload, key=mac
[2021-09-26T02:09:48,619] <webapi-243> WARN  sanitize - Invalid key exists in Device payload, key=adopted
[2021-09-26T02:09:48,620] <webapi-243> WARN  sanitize - Invalid key exists in Device payload, key=state
[2021-09-26T02:09:55,309] <fake-UDC48X6> ERROR dev    - dev[00:27:22:00:00:06] failed to update capability: api.err.InvalidReportPort

joshuaspence avatar Sep 26 '21 02:09 joshuaspence

Those sanitize logs are interesting though, I wonder if we could incorporate that output somehow in to the acc tests themselves.

paultyng avatar Sep 27 '21 20:09 paultyng