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
mgr/rook: Blinking lights #33366
mgr/rook: Blinking lights #33366
Conversation
|
|
you can run mypy locally as well: |
Thx!. |
|
I think that not all the types can be annotated properly.. or i do not know how to do that....if not is possible to reference "alien" types with mypy ... is a pity, because this implies to lose interesting comments about types that we had before "mypy" and the awesome PEP 484 has been applied as a new code purity check. :-) |
Sure, but I'm a bit 👎 for artificially reducing the tesing coverage. Those two type annotations are checked by mypy already! Removing them seems a bit odd to me. |
If i do not remove these two type annotations I have: Do you know how to tell mypy about the nature of V1Pod and V1ListMeta? |
Yes! This is the import statement you removed! https://github.com/ceph/ceph/pull/33366/files#diff-45db35bc78bc3027f9421bd371b19e9bL31 |
ahhhh!!!. Sorry ... fixed! |
|
The import has been replaced by "from kubernetes import client" |
|
I'd like to push to your repo. could you enable this flag? https://github.blog/2016-09-07-improving-collaboration-with-forks/ |
It was already enabled. |
|
ping? could you please apply From ff90c8335658c6668bf858dc1a555b4a56ab9d21 Mon Sep 17 00:00:00 2001
From: Sebastian Wagner <sebastian.wagner@suse.com>
Date: Fri, 21 Feb 2020 12:41:42 +0100
Subject: [PATCH] mgr/rook: Add type annotations for blink_light
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
---
src/pybind/mgr/rook/module.py | 1 +
src/pybind/mgr/rook/rook_cluster.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py
index 098ef66280..8364873ad2 100644
--- a/src/pybind/mgr/rook/module.py
+++ b/src/pybind/mgr/rook/module.py
@@ -447,6 +447,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
return c
def blink_device_light(self, ident_fault, on, locs):
+ # type: (str, bool, List[orchestrator.DeviceLightLoc]) -> RookCompletion
return write_completion(
on_complete=lambda: self.rook_cluster.blink_light(
ident_fault, on, locs),
diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py
index c08c6aefd7..06ffabcbc6 100644
--- a/src/pybind/mgr/rook/rook_cluster.py
+++ b/src/pybind/mgr/rook/rook_cluster.py
@@ -575,7 +575,7 @@ class RookCluster(object):
except ApiException as e:
log.error("Error getting ceph image: {}".format(e))
- def blink_light(self, ident_fault, on, locs):
+ def blink_light(self, ident_fault: str, on: bool, locs: List[orchestrator.DeviceLightLoc]):
operation_id = str(hash(locs))
message = ""
--
2.17.1 |
|
We are using in this PR Python 3 type annotations in the functions, but all the others type annotations in other functions are Python 2. |
|
@jmolmo ping? |
|
Tested in a real baremetal cluster: Execution example: In case of errors: |
|
In order to work this modification is needed to add new rights to the ceph manager module in rook: See: Ceph: Added rook manager module rights for read pod logs |
|
|
failures are not related.
|
|
@jmolmo needs rebase |
|
@jmolmo could remove the "merge" commit in this PR? |
Blinking lights implementation Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
Blinking lights implementation
In my "dev" environment ( only vms) I have tested the new
rook_cluster.blink_lightmethod calling it manually with several different "locs" parameter.But I need to have baremetal machines where this can be tested properly and switching on/off the disks identification lights can be verified.
My aim now is to make a integration test of this functionality to run in the Rook CI. But in parallel i will try to locate and to verify this on a real cluster.
Signed-off-by: Juan Miguel Olmo Martínez jolmomar@redhat.com