peteeckel/netbox-plugin-dns

DNS Record Webhook Returns Empty Tags

Closed this issue · 1 comments

Versions
NetBox Version: 3.7.4
NetBox DNS Version: 0.22.6
Python Version: 3.11.4

Describe the bug
On a DNS record creation, I'm triggering a webhook containing the record information, but tags are empty even if I specify a tag on the record.

To Reproduce
Steps to reproduce the behavior:

  1. Create webhook on event DNS Record creation
  2. Create DNS record with tag
  3. Get the payload of the webhook
  4. See error

Expected result

{
    "event": "created",
    "timestamp": "2024-05-29T08:16:26.466558+00:00",
    "model": "record",
    "username": "user.name",
    "request_id": "xxxxxxxx",
    "data": {
      "id": 74,
      "url": "/api/plugins/netbox-dns/records/74/",
      "zone": {
        "id": 1,
        "url": "/api/plugins/netbox-dns/zones/1/",
        "display": "example.com",
        "name": "example.com",
        "view": null,
        "status": "active",
        "active": true,
        "rfc2317_prefix": null
      },
      "display": "vm.example.com [A]",
      "type": "A",
      "name": "vm",
      "value": "192.0.1.2",
      "status": "active",
      "ttl": 60,
      "description": "Record for VM",
      "tags": [
      	{
		"id": 75,
		"url": "https://netbox.example.com/api/extras/tags/75/",
		"display": "tag",
		"name": "tag",
		"slug": "tag",
		"color": "ff9800"
	}
      ],
      "created": "2024-05-29T08:16:26.159847Z",
      "last_updated": "2024-05-29T08:16:26.159883Z",
      "managed": false,
      "disable_ptr": true,
      "address_record": null,
      "custom_fields": {},
      "tenant": null,
      "ipam_ip_address": null
    }
}

Actual result

{
    "event": "created",
    "timestamp": "2024-05-29T08:16:26.466558+00:00",
    "model": "record",
    "username": "user.name",
    "request_id": "xxxxxxxx",
    "data": {
      "id": 74,
      "url": "/api/plugins/netbox-dns/records/74/",
      "zone": {
        "id": 1,
        "url": "/api/plugins/netbox-dns/zones/1/",
        "display": "example.com",
        "name": "example.com",
        "view": null,
        "status": "active",
        "active": true,
        "rfc2317_prefix": null
      },
      "display": "vm.example.com [A]",
      "type": "A",
      "name": "vm",
      "value": "192.0.1.2",
      "status": "active",
      "ttl": 60,
      "description": "Record for VM",
      "tags": [ ],
      "created": "2024-05-29T08:16:26.159847Z",
      "last_updated": "2024-05-29T08:16:26.159883Z",
      "managed": false,
      "disable_ptr": true,
      "address_record": null,
      "custom_fields": {},
      "tenant": null,
      "ipam_ip_address": null
    }
}

Sigh ...

I'm very sorry. That's a duplicate of #89, which is essentially a NetBox issue.

There even is a PR for this, but it's taking forever to merge ...

Therefore, I'm closing this as a duplicate. Once the NetBox issue and, as a consequence, #89 is fixed, your issue will go away as well.