diff options
| author | Joshua Powers <josh.powers@canonical.com> | 2020-06-01 14:20:39 -0700 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-01 17:20:39 -0400 | 
| commit | 4ab3303ec4bb49f029b7821d6dba53a6b02b6dc1 (patch) | |
| tree | c60b8f1d4ca9735efee890042b9d32ab6bc51f7d /cloudinit/sources/helpers | |
| parent | 1211ab449bdfa34b8883c7386772155e6a516ebb (diff) | |
| download | vyos-cloud-init-4ab3303ec4bb49f029b7821d6dba53a6b02b6dc1.tar.gz vyos-cloud-init-4ab3303ec4bb49f029b7821d6dba53a6b02b6dc1.zip | |
test: fix all flake8 E741 errors (#401)
This removes the use of variables named ‘l’, ‘O’, or ‘I’. Generally
these are used in list comprehension to read the line of lines.
Diffstat (limited to 'cloudinit/sources/helpers')
| -rw-r--r-- | cloudinit/sources/helpers/openstack.py | 17 | 
1 files changed, 11 insertions, 6 deletions
| diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py index e91398ea..a4373f24 100644 --- a/cloudinit/sources/helpers/openstack.py +++ b/cloudinit/sources/helpers/openstack.py @@ -411,8 +411,11 @@ class ConfigDriveReader(BaseReader):          keydata = meta_js.get('public-keys', keydata)          if keydata:              lines = keydata.splitlines() -            md['public-keys'] = [l for l in lines -                                 if len(l) and not l.startswith("#")] +            md['public-keys'] = [ +                line +                for line in lines +                if len(line) and not line.startswith("#") +            ]          # config-drive-v1 has no way for openstack to provide the instance-id          # so we copy that into metadata from the user input @@ -674,11 +677,13 @@ def convert_net_json(network_json=None, known_macs=None):                  raise ValueError("Unable to find a system nic for %s" % d)              d['name'] = known_macs[mac] -        for cfg, key, fmt, target in link_updates: -            if isinstance(target, (list, tuple)): -                cfg[key] = [fmt % link_id_info[l]['name'] for l in target] +        for cfg, key, fmt, targets in link_updates: +            if isinstance(targets, (list, tuple)): +                cfg[key] = [ +                    fmt % link_id_info[target]['name'] for target in targets +                ]              else: -                cfg[key] = fmt % link_id_info[target]['name'] +                cfg[key] = fmt % link_id_info[targets]['name']      # Infiniband interfaces may be referenced in network_data.json by a 6 byte      # Ethernet MAC-style address, and we use that address to look up the | 
