diff options
author | Chad Smith <chad.smith@canonical.com> | 2017-12-15 15:24:53 -0700 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2017-12-15 15:24:53 -0700 |
commit | c6a6f59e80f1fd62562b1fe9acfd45e1cee3cbe8 (patch) | |
tree | 97d76fe696a8822618842b83335dec1b7e9cdf5a /cloudinit/net | |
parent | 4089e20c0a20bc2ad5c21b106687c4f3faf84b4b (diff) | |
download | vyos-cloud-init-c6a6f59e80f1fd62562b1fe9acfd45e1cee3cbe8.tar.gz vyos-cloud-init-c6a6f59e80f1fd62562b1fe9acfd45e1cee3cbe8.zip |
lint: Fix lints seen by pylint version 1.8.1.
This branch resolves lints seen by pylint revision 1.8.1 and updates our
pinned tox pylint dependency used by our tox pylint target.
Diffstat (limited to 'cloudinit/net')
-rwxr-xr-x | cloudinit/net/cmdline.py | 9 | ||||
-rw-r--r-- | cloudinit/net/network_state.py | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py index 38b27a52..7b2cc9db 100755 --- a/cloudinit/net/cmdline.py +++ b/cloudinit/net/cmdline.py @@ -116,10 +116,11 @@ def config_from_klibc_net_cfg(files=None, mac_addrs=None): prev = names[name]['entry'] if prev.get('mac_address') != entry.get('mac_address'): raise ValueError( - "device '%s' was defined multiple times (%s)" - " but had differing mac addresses: %s -> %s.", - (name, ' '.join(names[name]['files']), - prev.get('mac_address'), entry.get('mac_address'))) + "device '{name}' was defined multiple times ({files})" + " but had differing mac addresses: {old} -> {new}.".format( + name=name, files=' '.join(names[name]['files']), + old=prev.get('mac_address'), + new=entry.get('mac_address'))) prev['subnets'].extend(entry['subnets']) names[name]['files'].append(cfg_file) else: diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py index e9e2cf4e..31738c73 100644 --- a/cloudinit/net/network_state.py +++ b/cloudinit/net/network_state.py @@ -474,8 +474,9 @@ class NetworkStateInterpreter(object): elif bridge_stp in ['off', '0', 0]: bridge_stp = False else: - raise ValueError("Cannot convert bridge_stp value" - "(%s) to boolean", bridge_stp) + raise ValueError( + 'Cannot convert bridge_stp value ({stp}) to' + ' boolean'.format(stp=bridge_stp)) iface.update({'bridge_stp': bridge_stp}) interfaces.update({iface['name']: iface}) @@ -692,7 +693,8 @@ class NetworkStateInterpreter(object): elif cmd_type == "bond": self.handle_bond(v1_cmd) else: - raise ValueError('Unknown command type: %s', cmd_type) + raise ValueError('Unknown command type: {cmd_type}'.format( + cmd_type=cmd_type)) def _v2_to_v1_ipcfg(self, cfg): """Common ipconfig extraction from v2 to v1 subnets array.""" |