Skip to content

Skip netaddr call if address is None#933

Draft
MylesJP wants to merge 1 commit intojuju:masterfrom
MylesJP:fix/netaddr
Draft

Skip netaddr call if address is None#933
MylesJP wants to merge 1 commit intojuju:masterfrom
MylesJP:fix/netaddr

Conversation

@MylesJP
Copy link
Contributor

@MylesJP MylesJP commented Jun 2, 2025

A change was introduced to netaddr that no longer allows a None-type object to be passed to the IP parsing functions. This PR allows the netaddr call to be skipped if no IP address is provided. See bug report:

https://bugs.launchpad.net/ubuntu/+source/python-netaddr/+bug/2112346

A change was introduced to netaddr that no longer allows
a None-type object to be passed to the IP parsing functions.
This PR allows the netaddr call to be skipped if no IP
address is provided. See bug report:

https://bugs.launchpad.net/ubuntu/+source/python-netaddr/+bug/2112346
Copy link
Contributor

@gboutry gboutry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't #921 enough to fix your issue?

That was never synced to the charms themselves, but on locally built charm, I remember it did fix that particular issue.

return False
try:
address = netaddr.IPAddress(address)
if address:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that not covered by the check at L137?

@MylesJP MylesJP marked this pull request as draft June 3, 2025 15:56
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

Comments