/snap/lxd/40526/lib/python3/dist-packages/ceph/deployment
NameSizeModeActions
drive_selection/-0755rm
drive_group.py128970644editdlrm
hostspec.py20320644editdlrm
inventory.py27810644editdlrm
service_spec.py296060644editdlrm
translate.py25670644editdlrm
utils.py7500644editdlrm
__init__.py00644editdlrm
Edit: /snap/lxd/40526/lib/python3/dist-packages/ceph/deployment/utils.py (750B)
import ipaddress def unwrap_ipv6(address): # type: (str) -> str if address.startswith('[') and address.endswith(']'): return address[1:-1] return address def wrap_ipv6(address): # type: (str) -> str # We cannot assume it's already wrapped or even an IPv6 address if # it's already wrapped it'll not pass (like if it's a hostname) and trigger # the ValueError try: if ipaddress.ip_address(address).version == 6: return f"[{address}]" except ValueError: pass return address def is_ipv6(address): # type: (str) -> bool address = unwrap_ipv6(address) try: return ipaddress.ip_address(address).version == 6 except ValueError: return False