From e60abb23bf9929e29ad85ba53a7a7db9aa30a1ac Mon Sep 17 00:00:00 2001 From: Jorge Sasiain <jorge.sasiain@ehu.eus> Date: Wed, 26 Jul 2023 07:26:33 +0000 Subject: [PATCH] NAT-212/213: try to fix lint-documentation --- gso/services/ipam.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gso/services/ipam.py b/gso/services/ipam.py index 76cca4dd..c46650f3 100644 --- a/gso/services/ipam.py +++ b/gso/services/ipam.py @@ -46,8 +46,8 @@ REQUESTS_TIMEOUT = 20 # TODO: remove this! -# lab infoblox cert is not valid for the ipv4 address -# ... disable warnings for now +# lab infoblox cert isn't valid for the ipv4 address +# disable warnings for now requests.packages.urllib3.disable_warnings() @@ -299,11 +299,11 @@ def find_next_available_ip(infoblox_params, network_ref: str = ""): Args: ---- infoblox_params (settings.InfoBloxParams): infoblox params - network_ref (str): the network to find the next available ip, in InfoBlox reference format + network_ref (str): the network to find the next available IP, in InfoBlox reference format Returns: ------- - (str): next available ip in the network, or "NETWORK_FULL" if there's no space in the network + (str): next available IP in the network, or "NETWORK_FULL" if there's no space in the network """ r = requests.post( @@ -332,7 +332,7 @@ def allocate_host_inner( # noqa: C901 extattrs: Optional[dict] = None, ) -> Union[HostAddresses, str]: # TODO: should hostnames be unique - # (i.e. fail if hostname already exists in this domain/service)? + # (fail if hostname already exists in this domain/service)? if cname_aliases is None: cname_aliases = [] if extattrs is None: @@ -342,7 +342,7 @@ def allocate_host_inner( # noqa: C901 assert oss.IPAM.INFOBLOX infoblox_params = oss.IPAM.INFOBLOX - # If networks is not None, allocate host in those networks. + # If networks isn't None, allocate host in those networks. if networks: ipv4_network = networks[0] ipv6_network = networks[1] @@ -370,7 +370,7 @@ def allocate_host_inner( # noqa: C901 if ipv6_addr == "NETWORK_FULL": return "IPV6_NETWORK_FULL" - # Otherwise if addrs is not None, allocate host with those addresses. + # Otherwise if addrs isn't None, allocate host with those addresses. else: ipv4_addr = addrs[0] ipv6_addr = addrs[1] @@ -432,7 +432,7 @@ def allocate_host( # noqa: C901 service_type (str): the name of the service type (e.g. "TRUNK") service_networks (ServiceNetworks, optional): ipv4 and ipv6 network to allocate host host_addresses (HostAddresses, optional): ipv4 and ipv6 addresses to allocate host (service_networks has precedence) - cname_aliases (list, optional): to create cname records in addition to the host record + cname_aliases (list, optional): to create CNAME records in addition to the host record extattrs (dict, optional): any extensible attributes to add in IPAM (e.g. "Site": {"value": "dummy"}) Returns: @@ -570,7 +570,7 @@ def delete_network( ip_version = ip_network_version(str(network)) # Ensure that the network to be deleted is under the service type. - # Otherwise user is not allowed to delete it + # Otherwise user isn't allowed to delete it oss_ipv4_containers = getattr(ipam_params, service_type).V4.containers oss_ipv6_containers = getattr(ipam_params, service_type).V6.containers oss_ipv4_networks = getattr(ipam_params, service_type).V4.networks @@ -663,7 +663,7 @@ def delete_host( assert "_ref" in host_data[0], "Host to delete does not exist in IPAM." host_ref = host_data[0]["_ref"] - # Find cname records reference + # Find CNAME records reference r = requests.get( f"{wapi(infoblox_params)}/record:cname", params={ @@ -768,7 +768,7 @@ def validate_host( assert len(host_data) == 1, "Host to validate does not exist in IPAM." assert "_ref" in host_data[0], "Host to validate does not exist in IPAM." - # Find cname records reference + # Find CNAME records reference r = requests.get( f"{wapi(infoblox_params)}/record:cname", params={ -- GitLab