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] Removed older PIP added by community PR #146 #256

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
python-version: '3.11'

- name: Install ansible (${{ matrix.ansible-version }})
run: pip install pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check

- name: Build a collection tarball
run: ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs"
Expand Down
15 changes: 8 additions & 7 deletions plugins/lookup/nios_next_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '192.168.10.0/24', cidr=25, exclude=['192.168.10.0/25'],
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"

- name: return the available ipv6 network addresses for network-container 2001:1:111:1::0/64
set_fact:
networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '2001:1:111:1::0/64', cidr=126,
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the available ipv6 network addresses for network-container 2001:1:111:1::0/64
set_fact:
networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '2001:1:111:1::0/64', cidr=126,
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
"""

RETURN = """
Expand All @@ -90,6 +90,7 @@
from ..module_utils.api import NIOS_IPV4_NETWORK_CONTAINER, NIOS_IPV6_NETWORK_CONTAINER
import ipaddress


class LookupModule(LookupBase):

def run(self, terms, variables=None, **kwargs):
Expand All @@ -106,7 +107,7 @@ def run(self, terms, variables=None, **kwargs):
raise AnsibleError('missing CIDR argument in the form of xx')

if network.prefixlen >= cidr:
raise AnsibleError('cidr %s must be greater than parent network cidr %s' % (cidr,network.prefixlen))
raise AnsibleError('cidr %s must be greater than parent network cidr %s' % (cidr, network.prefixlen))

container_type = None
network_objects = None
Expand All @@ -125,14 +126,14 @@ def run(self, terms, variables=None, **kwargs):

# check for valid subnetting cidr
if network.prefixlen >= cidr:
raise AnsibleError('cidr %s must be greater than parent network cidr %s' % (cidr,network.prefixlen))
raise AnsibleError('cidr %s must be greater than parent network cidr %s' % (cidr, network.prefixlen))

provider = kwargs.pop('provider', {})
wapi = WapiLookup(provider)

if container_type is None:
raise AnsibleError('unable to identify network-container type')

network_objects = wapi.get_object(container_type, {'network': network.with_prefixlen})

if network_objects is None:
Expand Down
2 changes: 0 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pip==20.3.4; python_version == '2.6' or python_version=='2.7'
pip==22.2.2; python_version > '3.0'
infoblox-client
pytest
pytest-xdist
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pip==20.3.4; python_version == '2.6' or python_version=='2.7'
pip==22.2.2; python_version > '3.0'
infoblox-client
pytest
pytest-forked
Expand Down
Loading