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

Add infra_ipv6 attribute to devices #297

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Allow both IPv4 and IPv6 mgmt ip vars
  • Loading branch information
lunkwill42 committed Mar 31, 2023
commit 6c3ccd5a64acb6c49c54fc2fd3cc42e34e48b20c
6 changes: 3 additions & 3 deletions src/cnaas_nms/devicehandler/sync_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import time
from hashlib import sha256
from ipaddress import IPv4Address, IPv4Interface
from ipaddress import IPv4Address, IPv4Interface, ip_interface
from typing import List, Optional, Tuple

import yaml
Expand Down Expand Up @@ -156,11 +156,11 @@ def populate_device_vars(
"Could not find appropriate management domain for management_ip: {}".format(dev.management_ip)
)

mgmt_gw_ipif = IPv4Interface(mgmtdomain.ipv4_gw)
mgmt_gw_ipif = ip_interface(mgmtdomain.primary_gw)
access_device_variables = {
"mgmt_vlan_id": mgmtdomain.vlan,
"mgmt_gw": str(mgmt_gw_ipif.ip),
"mgmt_ipif": str(IPv4Interface("{}/{}".format(mgmt_ip, mgmt_gw_ipif.network.prefixlen))),
"mgmt_ipif": str(ip_interface("{}/{}".format(mgmt_ip, mgmt_gw_ipif.network.prefixlen))),
"mgmt_ip": str(mgmt_ip),
"mgmt_prefixlen": int(mgmt_gw_ipif.network.prefixlen),
"interfaces": [],
Expand Down