From 40d8f4050c77b9a0c9835858d6f37b856bb39dd1 Mon Sep 17 00:00:00 2001 From: Adam Byczkowski <38091261+qduk@users.noreply.github.com> Date: Mon, 21 Mar 2022 15:58:45 -0500 Subject: [PATCH] Inventory - GraphQL: Update primary ipv4 address to not include CIDR (#124) --- plugins/inventory/gql_inventory.py | 2 +- plugins/templates/graphql_default_query.j2 | 2 +- pyproject.toml | 2 +- tests/unit/inventory/test_data/graphql_groups/device_data.json | 2 +- tests/unit/inventory/test_graphql.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/inventory/gql_inventory.py b/plugins/inventory/gql_inventory.py index 4746072a..660a0433 100644 --- a/plugins/inventory/gql_inventory.py +++ b/plugins/inventory/gql_inventory.py @@ -177,7 +177,7 @@ def add_variable(self, host: str, var: str, var_type: str): def add_ipv4_address(self, device): """Add primary IPv4 address to host.""" if device["primary_ip4"]: - self.add_variable(device["name"], device["primary_ip4"]["address"], "ansible_host") + self.add_variable(device["name"], device["primary_ip4"]["host"], "ansible_host") else: self.add_variable(device["name"], device["name"], "ansible_host") diff --git a/plugins/templates/graphql_default_query.j2 b/plugins/templates/graphql_default_query.j2 index 7df9c06c..34405e80 100644 --- a/plugins/templates/graphql_default_query.j2 +++ b/plugins/templates/graphql_default_query.j2 @@ -7,7 +7,7 @@ devices {% include "graphql_filters.j2" %} { name } primary_ip4 { - address + host } device_role { name diff --git a/pyproject.toml b/pyproject.toml index 8bbc5d96..b4ef7c4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nautobot_ansible_modules" -version = "3.3.1" +version = "3.3.2" description = "Ansible collection to interact with Nautobot's API" authors = ["Network to Code