diff options
author | Scott Moser <smoser@ubuntu.com> | 2018-04-19 21:30:08 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2018-04-19 21:30:08 -0600 |
commit | 1081962eacf2814fea6f4fa3255c530de14e4a24 (patch) | |
tree | 5025c02d1215a9c0716c28499f1a9c3ee4c3e35b /cloudinit/net | |
parent | 53f3f551f8e5d3d86c428bc51161a7842dfe06f9 (diff) | |
download | vyos-cloud-init-1081962eacf2814fea6f4fa3255c530de14e4a24.tar.gz vyos-cloud-init-1081962eacf2814fea6f4fa3255c530de14e4a24.zip |
pylint: pay attention to unused variable warnings.
This enables warnings produced by pylint for unused variables (W0612),
and fixes the existing errors.
Diffstat (limited to 'cloudinit/net')
-rw-r--r-- | cloudinit/net/__init__.py | 2 | ||||
-rwxr-xr-x | cloudinit/net/cmdline.py | 2 | ||||
-rw-r--r-- | cloudinit/net/dhcp.py | 2 | ||||
-rw-r--r-- | cloudinit/net/sysconfig.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py index f69c0ef2..80054546 100644 --- a/cloudinit/net/__init__.py +++ b/cloudinit/net/__init__.py @@ -295,7 +295,7 @@ def apply_network_config_names(netcfg, strict_present=True, strict_busy=True): def _version_2(netcfg): renames = [] - for key, ent in netcfg.get('ethernets', {}).items(): + for ent in netcfg.get('ethernets', {}).values(): # only rename if configured to do so name = ent.get('set-name') if not name: diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py index 9e9fe0fe..f89a0f73 100755 --- a/cloudinit/net/cmdline.py +++ b/cloudinit/net/cmdline.py @@ -65,7 +65,7 @@ def _klibc_to_config_entry(content, mac_addrs=None): iface['mac_address'] = mac_addrs[name] # Handle both IPv4 and IPv6 values - for v, pre in (('ipv4', 'IPV4'), ('ipv6', 'IPV6')): + for pre in ('IPV4', 'IPV6'): # if no IPV4ADDR or IPV6ADDR, then go on. if pre + "ADDR" not in data: continue diff --git a/cloudinit/net/dhcp.py b/cloudinit/net/dhcp.py index 087c0c03..12cf5097 100644 --- a/cloudinit/net/dhcp.py +++ b/cloudinit/net/dhcp.py @@ -216,7 +216,7 @@ def networkd_get_option_from_leases(keyname, leases_d=None): if leases_d is None: leases_d = NETWORKD_LEASES_DIR leases = networkd_load_leases(leases_d=leases_d) - for ifindex, data in sorted(leases.items()): + for _ifindex, data in sorted(leases.items()): if data.get(keyname): return data[keyname] return None diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index 39d89c46..7a7f5093 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -364,7 +364,7 @@ class Renderer(renderer.Renderer): @classmethod def _render_subnet_routes(cls, iface_cfg, route_cfg, subnets): - for i, subnet in enumerate(subnets, start=len(iface_cfg.children)): + for _, subnet in enumerate(subnets, start=len(iface_cfg.children)): for route in subnet.get('routes', []): is_ipv6 = subnet.get('ipv6') or is_ipv6_addr(route['gateway']) |