auto H403 358ÂÀÃ f
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
$ ˆl–Ðz¾”ji?u4 \¸î*bÑ¿Ç „BóÿÆÁÄ ?÷ # This file is part of cloud-init. See LICENSE file ... import copy import io import logging import os import textwrap from tempfile import SpooledTemporaryFile from typing import Callable, List, Optional from cloudinit import features, safeyaml, subp, util from cloudinit.net import ( IPV6_DYNAMIC_TYPES, SYS_CLASS_NET, get_devicelist, renderer, should_add_gateway_onlink_flag, subnet_is_ipv6, ) from cloudinit.net.network_state import NET_CONFIG_TO_V2, NetworkState CLOUDINIT_NETPLAN_FILE = "/etc/netplan/50-cloud-init.yaml" KNOWN_SNAPD_CONFIG = b"""\ # This is the initial network config. # It can be overwritten by cloud-init or console-conf. network: version: 2 ethernets: all-en: match: name: "en*" dhcp4: true all-eth: match: name: "eth*" dhcp4: true """ LOG = logging.getLogger(__name__) def _get_params_dict_by_match(config, match): return dict( (key, value) for (key, value) in config.items() if key.startswith(match) ) def _extract_addresses(config: dict, entry: dict, ifname, features: Callable): """This method parse a cloudinit.net.network_state dictionary (config) and maps netstate keys/values into a dictionary (entry) to represent netplan yaml. (config v1 -> netplan) An example config dictionary might look like: {'mac_address': '52:54:00:12:34:00', 'name': 'interface0', 'subnets': [ {'address': '192.168.1.2/24', 'mtu': 1501, 'type': 'static'}, {'address': '2001:4800:78ff:1b:be76:4eff:fe06:1000", 'mtu': 1480, 'netmask': 64, 'type': 'static'}], 'type: physical', 'accept-ra': 'true' } An entry dictionary looks like: {'set-name': 'interface0', 'match': {'macaddress': '52:54:00:12:34:00'}, 'mtu': 1501} After modification returns {'set-name': 'interface0', 'match': {'macaddress': '52:54:00:12:34:00'}, 'mtu': 1501, 'address': ['192.168.1.2/24', '2001:4800:78ff:1b:be76:4eff:fe06:1000"], 'ipv6-mtu': 1480} """ def _listify(obj, token=" "): """ Helper to convert strings to list of strings, handle single string """ if not obj or not isinstance(obj, str): return obj if token in obj: return obj.split(token) else: return [ obj, ] addresses = [] routes = [] nameservers = [] searchdomains = [] subnets = config.get("subnets", []) if subnets is None: subnets = [] for subnet in subnets: sn_type = subnet.get("type") if sn_type.startswith("dhcp"): if sn_type == "dhcp": sn_type += "4" entry.update({sn_type: True}) elif sn_type in IPV6_DYNAMIC_TYPES: entry.update({"dhcp6": True}) elif sn_type in ["static", "static6"]: addr = "%s" % subnet.get("address") if "prefix" in subnet: addr += "/%d" % subnet.get("prefix") if subnet.get("gateway"): new_route = { "via": subnet.get("gateway"), "to": "default", } # If the gateway is not contained within the subnet's # network, mark it as on-link so that it can still be # reached. if should_add_gateway_onlink_flag(subnet["gateway"], addr): LOG.debug( "Gateway %s is not conta