]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: missing whitespace around operator (E225)
authorMichael Fritch <mfritch@suse.com>
Wed, 17 Feb 2021 03:53:24 +0000 (20:53 -0700)
committerMichael Fritch <mfritch@suse.com>
Wed, 3 Mar 2021 16:33:29 +0000 (09:33 -0700)
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm
src/cephadm/tox.ini

index 95ea5cfb2f85da3db714cd0a1f4e4a576f128c6b..06a16286659cf035c2e18a40c5cb33f7ead666d8 100755 (executable)
@@ -17,7 +17,7 @@ LOGROTATE_DIR = '/etc/logrotate.d'
 UNIT_DIR = '/etc/systemd/system'
 LOG_DIR_MODE = 0o770
 DATA_DIR_MODE = 0o700
-CONTAINER_INIT=True
+CONTAINER_INIT = True
 CONTAINER_PREFERENCE = ['podman', 'docker']  # prefer podman to docker
 MIN_PODMAN_VERSION = (2, 0, 2)
 CUSTOM_PS1 = r'[ceph: \u@\h \W]\$ '
@@ -465,7 +465,7 @@ class NFSGanesha(object):
         entrypoint = '/usr/bin/ganesha-rados-grace'
 
         assert self.pool
-        args=['--pool', self.pool]
+        args = ['--pool', self.pool]
         if self.namespace:
             args += ['--ns', self.namespace]
         if self.userid:
@@ -2588,7 +2588,7 @@ def _write_container_cmd_to_bash(ctx, file_obj, container, comment=None, backgro
         # unit file, makes it easier to read and grok.
         file_obj.write('# ' + comment + '\n')
     # Sometimes, adding `--rm` to a run_cmd doesn't work. Let's remove the container manually
-    file_obj.write('! '+ ' '.join(container.rm_cmd()) + ' 2> /dev/null\n')
+    file_obj.write('! ' + ' '.join(container.rm_cmd()) + ' 2> /dev/null\n')
     # Sometimes, `podman rm` doesn't find the container. Then you'll have to add `--storage`
     if 'podman' in ctx.container_path:
         file_obj.write(
@@ -2711,7 +2711,7 @@ def deploy_daemon_units(
             # make sure we also stop the tcmu container
             ceph_iscsi = CephIscsi.init(ctx, fsid, daemon_id)
             tcmu_container = ceph_iscsi.get_tcmu_runner_container()
-            f.write('! '+ ' '.join(tcmu_container.stop_cmd()) + '\n')
+            f.write('! ' + ' '.join(tcmu_container.stop_cmd()) + '\n')
             f.write(' '.join(CephIscsi.configfs_mount_umount(data_dir, mount=False)) + '\n')
         os.fchmod(f.fileno(), 0o600)
         os.rename(data_dir + '/unit.poststop.new',
@@ -3539,7 +3539,7 @@ def wait_for_mon(
     # wait for the service to become available
     def is_mon_available():
         # type: () -> bool
-        timeout=ctx.timeout if ctx.timeout else 60 # seconds
+        timeout = ctx.timeout if ctx.timeout else 60 # seconds
         out, err, ret = call(ctx, c.run_cmd(),
                              desc=c.entrypoint,
                              timeout=timeout)
@@ -3566,7 +3566,7 @@ def create_mgr(
     logger.info('Waiting for mgr to start...')
     def is_mgr_available():
         # type: () -> bool
-        timeout=ctx.timeout if ctx.timeout else 60 # seconds
+        timeout = ctx.timeout if ctx.timeout else 60 # seconds
         try:
             out = clifunc(['status', '-f', 'json-pretty'], timeout=timeout)
             j = json.loads(out)
@@ -4201,7 +4201,7 @@ def command_deploy(ctx):
         config_js = get_parm(ctx.config_json)  # type: Dict[str, str]
         if not daemon_ports:
             logger.info("cephadm-exporter will use default port ({})".format(CephadmDaemon.default_port))
-            daemon_ports =[CephadmDaemon.default_port]
+            daemon_ports = [CephadmDaemon.default_port]
            
         CephadmDaemon.validate_config(config_js)
         
@@ -5112,12 +5112,12 @@ def _adjust_grafana_ini(filename):
         with open(filename, "r") as grafana_ini:
             lines = grafana_ini.readlines()
         with open("{}.new".format(filename), "w") as grafana_ini:
-            server_section=False
+            server_section = False
             for line in lines:
                 if line.startswith('['):
-                    server_section=False
+                    server_section = False
                 if line.startswith('[server]'):
-                    server_section=True
+                    server_section = True
                 if server_section:
                     line = re.sub(r'^cert_file.*',
                                   'cert_file = /etc/grafana/certs/cert_file', line)
@@ -6342,7 +6342,7 @@ class HostFacts():
                         summary = {}  # type: Dict[str, int]
                         for line in profiles.split('\n'):
                             item, mode = line.split(' ')
-                            mode= mode.strip('()')
+                            mode = mode.strip('()')
                             if mode in summary:
                                 summary[mode] += 1
                             else:
index b7390220e36dac1ddd743ff4ab8f1d60d1dc6a9a..fbd078997946d4b4e61e88cfae393a9264b3e1fb 100644 (file)
@@ -5,7 +5,6 @@ skipsdist=true
 [flake8]
 max-line-length = 100
 ignore =
-    E225,
     E226,
     E231,
     E241,