Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacific: cephadm: pin flake8 to 5.0.4 #49058

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

idryomov
Copy link
Contributor

Backport #49040 to pacific.

to workaround zheller/flake8-quotes#110
flake8 v5.0.4 is the last known-to-work flake8 before flake8 v6.0.0.

Fixes: https://tracker.ceph.com/issues/58069
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit ecb3fb1)
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 2413da8)

Conflicts:
	qa/tasks/cephfs/test_full.py [ commit 485841b ("qa: import
	  CommandFailedError from exceptions not run") not in pacific ]
@idryomov
Copy link
Contributor Author

idryomov commented Nov 25, 2022

Hrm, there seems to be an additional, pacific-only unused import:

cephadm/services/exporter.py:11:5: F401 'cephadm.module.CephadmOrchestrator' imported but unused
1     F401 'cephadm.module.CephadmOrchestrator' imported but unused
ERROR: InvocationError for command /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/.tox/flake8/bin/flake8 --config=tox.ini cephadm cli_api nfs orchestrator prometheus (exited with code 1)

This is due to:

    def __init__(self, mgr, crt="", key="", token="", port=""):
        # type: (CephadmOrchestrator, str, str, str, str) -> None

While self is actually CephadmExporterConfig...

@idryomov
Copy link
Contributor Author

idryomov commented Nov 25, 2022

Pushed an additional pacific-only change:

diff --git a/src/pybind/mgr/cephadm/services/exporter.py b/src/pybind/mgr/cephadm/services/exporter.py
index d6bef885bc2f..ac1d5b38a161 100644
--- a/src/pybind/mgr/cephadm/services/exporter.py
+++ b/src/pybind/mgr/cephadm/services/exporter.py
@@ -17,8 +17,8 @@ class CephadmExporterConfig:
     required_keys = ['crt', 'key', 'token', 'port']
     DEFAULT_PORT = '9443'
 
-    def __init__(self, mgr, crt="", key="", token="", port=""):
-        # type: (CephadmOrchestrator, str, str, str, str) -> None
+    def __init__(self, mgr: "CephadmOrchestrator", crt: str = "", key: str = "",
+                 token: str = "", port: str = "") -> None:
         self.mgr = mgr
         self.crt = crt
         self.key = key

* use annotation style without comment
* add noqa to import statement to prevent flake8 from complaining
  those which import typing modules

to silence the warnings like:

```
flake8 run-test: commands[0] | flake8 --config=tox.ini alerts balancer cephadm cli_api crash devicehealth diskprediction_local hello iostat localpool nfs orchestrator prometheus selftest
cephadm/schedule.py:5:1: F401 'typing.Callable' imported but unused
cephadm/schedule.py:8:1: F401 'ceph.deployment.service_spec.ServiceSpec' imported but unused
cephadm/tests/fixtures.py:17:1: F401 'orchestrator.OrchResult' imported but unused
orchestrator/module.py:4:1: F401 'typing.Set' imported but unused
orchestrator/module.py:17:1: F401 'ceph.deployment.inventory.Device' imported but unused
prometheus/module.py:17:1: F401 'typing.DefaultDict' imported but unused
6     F401 'typing.Callable' imported but unused
ERROR: InvocationError for command /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/.tox/flake8/bin/flake8 --config=tox.ini alerts
```

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

Conflicts:
	src/pybind/mgr/orchestrator/module.py [ commit 28314ce
	  ("mgr/cephadm: Adding support for natural sorting") not in
	  pacific ]
	src/pybind/mgr/cephadm/services/exporter.py [ additional
	  pacific-only change, this file doesn't exist in main ]
@idryomov
Copy link
Contributor Author

jenkins test api

@ljflores
Copy link
Contributor

Rados suite review by @amathuria:

https://pulpito.ceph.com/?branch=wip-yuri10-testing-2022-11-28-1042-pacific

Failures, unrelated:
1. https://tracker.ceph.com/issues/53501 - Failure: [Errno 2] Cannot find file on the remote 'ubuntu@smithi187.front.sepia.ceph.com': 'rook/cluster/examples/kubernetes/ceph/operator.yaml'
2. https://tracker.ceph.com/issues/44595 - src/test/osd/RadosModel.h: 1942: ceph_abort_msg("abort() called")
3. https://tracker.ceph.com/issues/58114 - mon: FAILED ceph_assert(rank == new_rank)
4. https://tracker.ceph.com/issues/58097 - qa/workunits/post-file.sh: kex_exchange_identification: read: Connection reset by peer
5. https://tracker.ceph.com/issues/58046 - qa/workunits/rados/test_librados_build.sh: specify redirect in curl command
6. https://tracker.ceph.com/issues/51372 - pacific: libcephsqlite: segmentation fault
7. https://tracker.ceph.com/issues/54071 - rados/cephadm/osds: Invalid command: missing required parameter hostname()
8. https://tracker.ceph.com/issues/58130 -- rados_api_tests: HEALTH_WARN: Degraded data redundancy: 1/5 objects degraded (20.000%), 1 pg degraded - Ceph - RADOS

@ljflores ljflores merged commit b03d823 into ceph:pacific Nov 30, 2022
@idryomov idryomov deleted the wip-cephadm-flake8-pacific branch December 1, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants