From: Michael Fritch Date: Tue, 4 May 2021 18:37:56 +0000 (-0600) Subject: cephadm: reduce `noqa` usage X-Git-Tag: v16.2.5~115^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1037a761a06bbc2b812c5e86cee6f4983d819973;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 (cherry picked from commit fa75096e68110e8673d3c1cfede92c50af97a676) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 5a5a9697750..9766256d347 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1211,7 +1211,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) @@ -5562,10 +5562,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 @@ -5574,8 +5574,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])