sysconfig render does not support type manual subnets
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Ryan Harper |
Bug Description
Attempting to a render a network configuration like this:
% cat manual_subnet.yaml
network:
version: 1
config:
# Physical interfaces.
- type: physical
name: interface0
subnets:
- type: manual
Attempting to render this into sysconfig results in a traceback.
% PYTHONPATH=`pwd` ./tools/
Traceback (most recent call last):
File "./tools/
main()
File "./tools/
r.render_
File "/home/
network_
File "/home/
cls.
File "/home/
cls.
File "/home/
iface_
ValueError: Unknown subnet type 'manual' found for interface 'interface0'
Sysconfig does have an equivalent of eni's 'manual' control mode, the ONBOOT=N setting tells sysconfig to ignore this interface when booting. Later users can ifup the interface.
1. no cloud, just in-tree rendering
2. cloud-init master branch
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Ryan Harper: Approve
-
Diff: 85 lines (+49/-0)2 files modifiedcloudinit/net/sysconfig.py (+3/-0)
tests/unittests/test_net.py (+46/-0)
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Ryan Harper (raharper) |
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
commit 79795bd3098c3be f1fb39cc62bc8d1 b3a2a81e5f
Author: Ryan Harper <email address hidden>
Date: Thu Jun 15 13:12:03 2017 -0500
sysconfig: handle manual type subnets
diff --git a/cloudinit/ net/sysconfig. py b/cloudinit/ net/sysconfig. py net/sysconfig. py net/sysconfig. py renderer. Renderer) : 'BOOTPROTO' ] = 'static' is_ipv6( subnet) :
iface_cfg[ 'IPV6INIT' ] = True
raise ValueError("Unknown subnet type '%s' found"
" for interface '%s'" % (subnet_type,
index 4edde3c..b81e57a 100644
--- a/cloudinit/
+++ b/cloudinit/
@@ -291,6 +291,8 @@ class Renderer(
# iface_cfg[
if subnet_
+ elif subnet_type == 'manual':
+ iface_cfg['ONBOOT'] = False
else: