terraform-provider-unifi
terraform-provider-unifi copied to clipboard
Allow device adoption
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.
Tests should be fixed by #190
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
Those sanitize logs are interesting though, I wonder if we could incorporate that output somehow in to the acc tests themselves.