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

could not create object IPv6 unless I add a Mac #382

Closed
maxadamo opened this issue Jul 24, 2024 · 1 comment
Closed

could not create object IPv6 unless I add a Mac #382

maxadamo opened this issue Jul 24, 2024 · 1 comment

Comments

@maxadamo
Copy link

maxadamo commented Jul 24, 2024

I am using version 0.6.0 of this library and I am importing objects:

from infoblox_client import objects

I got these two examples working:

objects.IPv4.create(ip="192.168.0.1")
objects.IPv6.create(ip="2001:798:3::257", mac="00:50:56:a1:43:5b")

but this one is failing:

objects.IPv6.create(ip="2001:798:3::257")

and this is the error:

ValueError                                Traceback (most recent call last)
Cell In[27], line 1
----> 1 objects.IPv6.create(ip="2001:798:3::257")

File ~/venv/terraformware/lib/python3.12/site-packages/infoblox_client/objects.py:543, in IP.create(cls, ip, mac, **kwargs)
    541     raise ValueError
    542 if ib_utils.determine_ip_version(ip) == 6:
--> 543     return IPv6(ip=ip, duid=ib_utils.generate_duid(mac),
    544                 **kwargs)
    545 else:
    546     return IPv4(ip=ip, mac=mac, **kwargs)

File ~/venv/terraformware/lib/python3.12/site-packages/infoblox_client/utils.py:47, in generate_duid(mac)
     45 valid = mac and isinstance(mac, six.string_types)
     46 if not valid:
---> 47     raise ValueError("Invalid argument was passed")
     48 return "00:" + mac[9:] + ":" + mac

ValueError: Invalid argument was passed
@maxadamo
Copy link
Author

duplicate of #346

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

No branches or pull requests

1 participant