From fa75096e68110e8673d3c1cfede92c50af97a676 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Tue, 4 May 2021 12:37:56 -0600 Subject: [PATCH] cephadm: reduce `noqa` usage - E722 do not use bare 'except' - W504 line break occurred after a binary operator Signed-off-by: Michael Fritch --- src/cephadm/cephadm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index afb57d5587d02..b29b79ddeaa30 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1190,7 +1190,7 @@ class FileLock(object): lock_id, lock_filename, poll_intervall ) time.sleep(poll_intervall) - except: # noqa + except Exception: # Something did go wrong, so decrement the counter. self._lock_counter = max(0, self._lock_counter - 1) @@ -5505,10 +5505,10 @@ def command_rm_cluster(ctx): _zap_osds(ctx) # rm units - call_throws(ctx, ['rm', '-f', ctx.unit_dir + # noqa: W504 - '/ceph-%s@.service' % ctx.fsid]) - call_throws(ctx, ['rm', '-f', ctx.unit_dir + # noqa: W504 - '/ceph-%s.target' % ctx.fsid]) + call_throws(ctx, ['rm', '-f', ctx.unit_dir + + '/ceph-%s@.service' % ctx.fsid]) + call_throws(ctx, ['rm', '-f', ctx.unit_dir + + '/ceph-%s.target' % ctx.fsid]) call_throws(ctx, ['rm', '-rf', ctx.unit_dir + '/ceph-%s.target.wants' % ctx.fsid]) # rm data @@ -5517,8 +5517,8 @@ def command_rm_cluster(ctx): if not ctx.keep_logs: # rm logs call_throws(ctx, ['rm', '-rf', ctx.log_dir + '/' + ctx.fsid]) - call_throws(ctx, ['rm', '-rf', ctx.log_dir + # noqa: W504 - '/*.wants/ceph-%s@*' % ctx.fsid]) + call_throws(ctx, ['rm', '-rf', ctx.log_dir + + '/*.wants/ceph-%s@*' % ctx.fsid]) # rm logrotate config call_throws(ctx, ['rm', '-f', ctx.logrotate_dir + '/ceph-%s' % ctx.fsid]) -- 2.39.5