]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: reduce `noqa` usage 41175/head
authorMichael Fritch <mfritch@suse.com>
Tue, 4 May 2021 18:37:56 +0000 (12:37 -0600)
committerMichael Fritch <mfritch@suse.com>
Wed, 5 May 2021 13:57:07 +0000 (07:57 -0600)
- E722 do not use bare 'except'
- W504 line break occurred after a binary operator

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index afb57d5587d02967481042211ba8351bc1dcc36f..b29b79ddeaa304a3ffdf21cb95251621b071ee56 100755 (executable)
@@ -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])