summaryrefslogtreecommitdiff
path: root/cloudinit/net
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-06-15 16:15:28 -0700
committerJoshua Harlow <harlowja@gmail.com>2016-06-15 16:15:28 -0700
commita454a6408b3c7ecc816073049d060632191099bb (patch)
tree87e3a05675a8951bb52838cfe530a70994863c69 /cloudinit/net
parent459de83024b41c32823b75cf483da994fb1388b7 (diff)
downloadvyos-cloud-init-a454a6408b3c7ecc816073049d060632191099bb.tar.gz
vyos-cloud-init-a454a6408b3c7ecc816073049d060632191099bb.zip
Fix line length issues
Diffstat (limited to 'cloudinit/net')
-rw-r--r--cloudinit/net/eni.py13
-rw-r--r--cloudinit/net/sysconfig.py14
2 files changed, 8 insertions, 19 deletions
diff --git a/cloudinit/net/eni.py b/cloudinit/net/eni.py
index 352f7dd5..c8adb1ae 100644
--- a/cloudinit/net/eni.py
+++ b/cloudinit/net/eni.py
@@ -308,19 +308,6 @@ class Renderer(renderer.Renderer):
self.netrules_path = config.get(
'netrules_path', 'etc/udev/rules.d/70-persistent-net.rules')
- def _render_persistent_net(self, network_state):
- """Given state, emit udev rules to map mac to ifname."""
- content = ""
- interfaces = network_state.get('interfaces')
- for iface in interfaces.values():
- # for physical interfaces write out a persist net udev rule
- if iface['type'] == 'physical' and \
- 'name' in iface and iface.get('mac_address'):
- content += generate_udev_rule(iface['name'],
- iface['mac_address'])
-
- return content
-
def _render_route(self, route, indent=""):
"""When rendering routes for an iface, in some cases applying a route
may result in the route command returning non-zero which produces
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index dd005796..c53acf71 100644
--- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py
@@ -20,8 +20,6 @@ import six
from cloudinit.distros.parsers import resolv_conf
from cloudinit import util
-from .udev import generate_udev_rule
-
from . import renderer
@@ -287,7 +285,8 @@ class Renderer(renderer.Renderer):
@classmethod
def _render_physical_interfaces(cls, network_state, iface_contents):
- for iface in network_state.iter_interfaces(renderer.filter_by_physical):
+ physical_filter = renderer.filter_by_physical
+ for iface in network_state.iter_interfaces(physical_filter):
iface_name = iface['name']
iface_subnets = iface.get("subnets", [])
iface_cfg = iface_contents[iface_name]
@@ -304,7 +303,8 @@ class Renderer(renderer.Renderer):
@classmethod
def _render_bond_interfaces(cls, network_state, iface_contents):
- for iface in network_state.iter_interfaces(renderer.filter_by_type('bond')):
+ bond_filter = renderer.filter_by_type('bond')
+ for iface in network_state.iter_interfaces(bond_filter):
iface_name = iface['name']
iface_cfg = iface_contents[iface_name]
cls._render_bonding_opts(iface_cfg, iface)
@@ -322,7 +322,8 @@ class Renderer(renderer.Renderer):
@staticmethod
def _render_vlan_interfaces(network_state, iface_contents):
- for iface in network_state.iter_interfaces(renderer.filter_by_type('vlan')):
+ vlan_filter = renderer.filter_by_type('vlan')
+ for iface in network_state.iter_interfaces(vlan_filter):
iface_name = iface['name']
iface_cfg = iface_contents[iface_name]
iface_cfg['VLAN'] = True
@@ -341,7 +342,8 @@ class Renderer(renderer.Renderer):
@classmethod
def _render_bridge_interfaces(cls, network_state, iface_contents):
- for iface in network_state.iter_interfaces(renderer.filter_by_type('bridge')):
+ bridge_filter = renderer.filter_by_type('bridge')
+ for iface in network_state.iter_interfaces(bridge_filter):
iface_name = iface['name']
iface_cfg = iface_contents[iface_name]
iface_cfg.kind = 'bridge'