Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to delete Virtual Network Assignment #69

Closed
2 tasks done
lewiscouldwell opened this issue Jul 20, 2022 · 1 comment
Closed
2 tasks done

Failing to delete Virtual Network Assignment #69

lewiscouldwell opened this issue Jul 20, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@lewiscouldwell
Copy link

Prerequisites

  • Have you tested the operation in the API directly?
  • Do you have the latest Ansible collection version?

Describe the bug
I'm attempting to remove a Virtual Network from an SDA site using the payload below.

  - name: Delete VNs from Fabric
    cisco.dnac.sda_virtual_network:
      <<: *dnac_login
      state: absent
      siteNameHierarchy: "Global/United Kingdom/Area/Building"
      virtualNetworkName: "LAN_VN"

However this complains stating i am missing 'payload', when its not mentioned as been required in either the API or the Ansible module, see below.

    },
    "msg": [
        "state is absent but any of the following are missing: payload"
    ]

However, i then tried to enter the payload to see if could bypass this error as shown below.

  - name: Delete VNs from Fabric
    cisco.dnac.sda_virtual_network:
      <<: *dnac_login
      state: absent
      payload: 
      siteNameHierarchy: "Global/United Kingdom/Area/Building"
      virtualNetworkName: "DEFAULT_VN"

But unfortunatley i was presented with yet another error. See full traceback below

              {
                  "virtualNetworkName": "DEFAULT_VN",
                  "siteNameHierarchy": "Global/United Kingdom/Area/Building"
              }

Response
        Status: 200 - OK
        Headers: 
                Content-Type: application/json
                Content-Length: 429
                Connection: keep-alive
                bapiexecutionid: afa11138-8f76-4fef-a659-c1fd638d8f7f
                Server: webserver
                Date: Wed, 20 Jul 2022 15:12:14 GMT
                x-request-id: e8f2b329699d364e972de9c88c480cd5
                Vary: Origin
                Access-Control-Allow-Origin: sdlabs.lan
                Via: api-gateway
                Cache-Control: no-store
                Pragma: no-cache
                Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data:
                X-Content-Type-Options: nosniff
                X-XSS-Protection: 1
                Strict-Transport-Security: max-age=31536000; includeSubDomains
                X-Frame-Options: SAMEORIGIN
        Body:
             {
                 "siteNameHierarchy": "Global/United Kingdom/Area/Building",
                 "virtualNetworkName": "DEFAULT_VN",
                 "fabricName": "Default LAN Fabric",
                 "isInfraVN": false,
                 "isDefaultVN": true,
                 "virtualNetworkContextId": "963d3e5f-3fd5-4b1a-a157-86a2e20ed22a",
                 "status": "success",
                 "description": "Virtual Network info retrieved successfully from SDA Fabric.",
                 "executionId": "afa11138-8f76-4fef-a659-c1fd638d8f7f"
             }
The full traceback is:
Traceback (most recent call last):
  File "/home/******/venv/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 119, in run
    item_results = self._run_loop(items)
  File "/home/******/venv/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 354, in _run_loop
    res = self._execute(variables=task_vars)
  File "/home/******/venv/lib/python3.8/site-packages/ansible/executor/task_executor.py", line 600, in _execute
    result = self._handler.run(task_vars=variables)
  File "/home/******/.ansible/collections/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network.py", line 216, in run
    response = obj.delete()
  File "/home/******/.ansible/collections/ansible_collections/cisco/dnac/plugins/action/sda_virtual_network.py", line 147, in delete
    id = self.new_object.get("id") or requested_obj.get("id")
AttributeError: 'NoneType' object has no attribute 'get'
fatal: [dnac_servers]: FAILED! => {
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

Expected behavior
The Virtual network should be successfully removed from the SDA Fabric

Screenshots
image

Environment (please complete the following information):

  • Cisco DNA Center Version and patch: 2.3.3.0
  • Ansible Version: 2.13.1
  • Collection version: 6.5.0
  • OS Version: 2.5.1
@bvargasre
Copy link
Collaborator

Hi @lewiscouldwell , thanks for reporting the bug, the new dnacenter-ansible version v6.5.2 is expected to fix this error.

@bvargasre bvargasre added the bug Something isn't working label Jul 21, 2022
ajithandrewj pushed a commit to ajithandrewj/dnacenter-ansible that referenced this issue Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants