summaryrefslogtreecommitdiff
path: root/cloudinit/net/renderer.py
Commit message (Collapse)AuthorAgeFilesLines
* gce: activate network discovery on every boot (#2128)Alberto Contreras2023-04-271-1/+1
| | | | | | | Google wants to allow users to make changes on nics while the instance is stopped. Activate network discovery on every boot. Additionally, skip the call to `netplan generate` if the rendered config is the same on subsequent boots.
* Remove dead code (#2038)Brett Holman2023-03-031-20/+1
|
* Refactor: Drop inheritance from object (#1728)Alberto Contreras2022-09-141-1/+1
| | | As we do not support python2 anymore, we can remove those 8 chars.
* net: Passthough v2 netconfigs in netplan systems (#1650)Alberto Contreras2022-08-241-2/+11
| | | | | | | Adhere to Netplan Passthrough documented behavior, not limiting v2 netplan configs to the subset of props that cloud-init supports. LP: #1978543
* Fix KeyError when rendering sysconfig IPv6 routes (#1380)James Falcon2022-04-141-2/+2
| | | | | | | | Route rendering code was expecting a netmask rather than using the prefix. A prefix is provided to the renderer, but was being hidden from the route rendering code. This commit exposes the prefix and prefers it for IPv6, given how uncommon netmasks are for IPv6. LP: #1958506
* Adopt Black and isort (SC-700) (#1157)James Falcon2021-12-151-13/+18
| | | | | Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
* renderer: convert relative imports to absolute (#1052)Paride Legovini2021-10-071-2/+2
| | | | | | | | | Fixes the following pylint error: cloudinit/net/renderer.py:12: [E0611(no-name-in-module), ] No name 'generate_udev_rule' in module 'udev' Likely a false positive, but we don't really need to keep the imports relative, so let's convert them to absolute as a workaround.
* Add new network activators to bring up interfaces (#919)James Falcon2021-07-011-0/+2
| | | | | | | | | | | | Currently _bring_up_interfaces() is a no-op for any distro using renderers. We need to be able to support bringing up a single interfaces, a list of interfaces, and all interfaces. This should be independent of the renderers, as the network config is often generated independent of the mechanism used to apply it. Additionally, I included a refactor to remove "_supported_write_network_config". We had a confusing call chain of apply_network_config->_write_network_config->_supported_write_network_config. The last two have been combined.
* Drop most of the remaining use of six (#179)Daniel Watkins2020-01-211-2/+2
|
* sysconfig: refactor sysconfig to accept distro specific templates pathsRyan Harper2018-09-051-3/+6
| | | | | | Multiple distros use sysconfig format but have different content and paths to certain files. Update distros to specify these template paths in their renderer_configs dictionary.
* sysconfig: fix rendering of bond, bridge and vlan types.Ryan Harper2017-07-201-0/+4
| | | | | | | | | | | | Previously, virtual types (bond, bridge, vlan) were almost completely broken. They would not get any network configuration (ip addresses or dhcp config) and or routes rendered. This fixes those issues. For bonds we now correctly render BONDING_SLAVE entries. Also add tests for simple bond, bridge and vlan. LP: #1695092
* Azure: Add network-config, Refactor net layer to handle duplicate macs.Ryan Harper2017-06-271-1/+3
| | | | | | | | | | | | | | | | On systems with network devices with duplicate mac addresses, cloud-init will fail to rename the devices according to the specified network configuration. Refactor net layer to search by device driver and device id if available. Azure systems may have duplicate mac addresses by design. Update Azure datasource to run at init-local time and let Azure datasource generate a fallback networking config to handle advanced networking configurations. Lastly, add a 'setup' method to the datasources that is called before userdata/vendordata is processed but after networking is up. That is used here on Azure to interact with the 'fabric'.
* test: add running of pylintJoshua Powers2017-03-241-0/+5
| | | | | Now tox will run pylint. The .pylintrc file sets pylint to only produce errors, and will ignore certain classes that are known problematic (six).
* net: add renderers for automatically selecting the renderer.Scott Moser2017-03-171-0/+5
| | | | | | | | | | | | | | | | | | | | Previously, the distro had hard coded which network renderer it would use. This adds support for just picking the right renderer based on what is available. Now, that can be set via a priority in system_info, but should generally work. That config looks like: system_info: network: renderers: ["eni", "sysconfig"] When no renderers are found, a specific RendererNotFoundError is raised. stages.py is modified to catch that and log it at error level. This path should not really be exercised, but could occur if for example an Ubuntu system did not have ifupdown, or a rhel system did not have sysconfig. In such a system previously we would have quietly rendered ENI configuration but that would have been ignored. This is one step better in that we at least log the error.
* LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm2016-12-221-15/+6
| | | | | | | | | | | | | | | | | | This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
* Fixup code review commentsJoshua Harlow2016-06-151-0/+48