From: Michael Fritch Date: Tue, 4 May 2021 18:37:56 +0000 (-0600) Subject: cephadm: reduce `noqa` usage X-Git-Tag: v17.1.0~2008^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fa75096e68110e8673d3c1cfede92c50af97a676;p=ceph.git cephadm: reduce `noqa` usage - E722 do not use bare 'except' - W504 line break occurred after a binary operator Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index afb57d5587d0..b29b79ddeaa3 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])