summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
authorParide Legovini <paride.legovini@canonical.com>2020-08-25 17:21:18 +0200
committerGitHub <noreply@github.com>2020-08-25 09:21:18 -0600
commit07104504ab5b30efd2d1f7a8c36effe18b8e5fe0 (patch)
treec441dddd012f81dad39cfe97821d83bc7ee1a82b /cloudinit/distros/__init__.py
parent4068137e3ef048d3e2da56a8190f682eb19d501e (diff)
downloadvyos-cloud-init-07104504ab5b30efd2d1f7a8c36effe18b8e5fe0.tar.gz
vyos-cloud-init-07104504ab5b30efd2d1f7a8c36effe18b8e5fe0.zip
tox: bump the pylint version to 2.6.0 in the default run (#544)
Changes: tox: bump the pylint version to 2.6.0 in the default run Fix pylint 2.6.0 W0707 warnings (raise-missing-from)
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rwxr-xr-xcloudinit/distros/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index effb4276..2537608f 100755
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -607,10 +607,11 @@ class Distro(metaclass=abc.ABCMeta):
lock_tools = (['passwd', '-l', name], ['usermod', '--lock', name])
try:
cmd = next(tool for tool in lock_tools if subp.which(tool[0]))
- except StopIteration:
+ except StopIteration as e:
raise RuntimeError((
"Unable to lock user account '%s'. No tools available. "
- " Tried: %s.") % (name, [c[0] for c in lock_tools]))
+ " Tried: %s.") % (name, [c[0] for c in lock_tools])
+ ) from e
try:
subp.subp(cmd)
except Exception as e: