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

Fix IPv6 address 'from-pool' default value #270

Conversation

samburney
Copy link
Contributor

SUMMARY

When not set, the RouterOS API always returns the IPv6 Address 'from-pool' value as '', however _api_data.py has no default value set.

This PR fixes this issue.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

Test task:

  tasks:
    - name: Add IPv6 address with defaults
      community.routeros.api_modify:
        path: ipv6 address
        handle_absent_entries: remove
        handle_entries_content: remove
        data:
          - address: fedc:1234:5678:abcd::1/64
            interface: ether1

Output from api_info:

TASK [Print output of queue_simple_api_info] **************************************************************************************************************************************
ok: [testrtr1] => {
    "queue_simple_api_info": {
        "changed": false,
        "failed": false,
        "result": [
            {
                "!comment": null,
                ".id": "*9",
                "address": "fedc:1234:5678:abcd::1/64",
                "interface": "ether1"
            }
        ]
    }
}

Before change:

TASK [Add IPv6 address with defaults] *********************************************************************************************************************************************
--- before
+++ after
@@ -1,14 +1,8 @@
 {
     "data": [
         {
-            ".id": "*9",
             "address": "fedc:1234:5678:abcd::1/64",
-            "advertise": true,
-            "disabled": false,
-            "eui-64": false,
-            "from-pool": "",
-            "interface": "ether1",
-            "no-dad": false
+            "interface": "ether1"
         }
     ]
 }

changed: [testrtr1]

After change:

TASK [Add IPv6 address with defaults] *********************************************************************************************************************************************
ok: [testrtr1]

Copy link

codecov bot commented Mar 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.99%. Comparing base (a3fbe88) to head (f5c1b4b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #270   +/-   ##
=======================================
  Coverage   82.99%   82.99%           
=======================================
  Files          32       32           
  Lines        4051     4051           
  Branches      873      873           
=======================================
  Hits         3362     3362           
  Misses        506      506           
  Partials      183      183           
Flag Coverage Δ
integration 66.86% <ø> (ø)
sanity 22.08% <ø> (ø)
units 82.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samburney samburney marked this pull request as ready for review March 30, 2024 13:11
@felixfontein felixfontein merged commit 99581a0 into ansible-collections:main Apr 17, 2024
45 checks passed
@felixfontein
Copy link
Collaborator

@samburney thanks again!

Copy link

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and the docs are now incorporated into main:
https://ansible-collections.github.io/community.routeros/branch/main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants