]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: annotate variable without comment
authorKefu Chai <tchaikov@gmail.com>
Thu, 24 Nov 2022 05:46:27 +0000 (13:46 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 25 Nov 2022 11:56:16 +0000 (12:56 +0100)
to silence the warning like
```
flake8 run-test: commands[0] | flake8 --select=F,E9 --exclude=venv,.tox
./tasks/cephfs/test_full.py:6:5: F401 'typing.Optional' imported but unused
```

since we've migrated to python3.6 and up, there is no need to be
compatible with Python 2 anymore.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit 2413da8c854bc46e79ca8d6e84f789f99747c203)

Conflicts:
qa/tasks/cephfs/test_full.py [ commit 485841b255e1 ("qa: import
  CommandFailedError from exceptions not run") not in pacific ]

qa/tasks/cephfs/test_full.py

index 2b7166d6b2be2ccee30c0b2058c862e83057fb60..8282b4e0c6663050605bf99d6a7b501c465ddd14 100644 (file)
@@ -2,11 +2,7 @@ import json
 import logging
 import os
 from textwrap import dedent
-try:
-    from typing import Optional
-except:
-    # make it work for python2
-    pass
+from typing import Optional
 from teuthology.orchestra.run import CommandFailedError
 from tasks.cephfs.fuse_mount import FuseMount
 from tasks.cephfs.cephfs_test_case import CephFSTestCase
@@ -22,7 +18,7 @@ class FullnessTestCase(CephFSTestCase):
     data_only = False
 
     # Subclasses define how many bytes should be written to achieve fullness
-    pool_capacity = None  # type: Optional[int]
+    pool_capacity: Optional[int] = None
     fill_mb = None
 
     def is_full(self):