]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/orchestrator: fix yaml representer return type
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 20 Jan 2024 15:45:46 +0000 (10:45 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 23 Jan 2024 14:45:40 +0000 (09:45 -0500)
Found using mypy 0.990. The `yaml_representer` function returns a Node
type, not Any. Newer versions of mypy understand this and complain.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/orchestrator/_interface.py
src/pybind/mgr/orchestrator/module.py

index 5bde317d19e67dcd7fcae2177bf62a609527b700..81aa66964eeab810fee4e652ec21c705266bf104 100644 (file)
@@ -1277,7 +1277,7 @@ class DaemonDescription(object):
         return DaemonDescription.from_json(self.to_json())
 
     @staticmethod
-    def yaml_representer(dumper: 'yaml.SafeDumper', data: 'DaemonDescription') -> Any:
+    def yaml_representer(dumper: 'yaml.Dumper', data: 'DaemonDescription') -> yaml.Node:
         return dumper.represent_dict(cast(Mapping, data.to_json().items()))
 
 
@@ -1410,7 +1410,7 @@ class ServiceDescription(object):
         return cls(spec=spec, events=events, **c_status)
 
     @staticmethod
-    def yaml_representer(dumper: 'yaml.SafeDumper', data: 'ServiceDescription') -> Any:
+    def yaml_representer(dumper: 'yaml.Dumper', data: 'ServiceDescription') -> yaml.Node:
         return dumper.represent_dict(cast(Mapping, data.to_json().items()))
 
 
index 8c496b777c5e92bed2d1c98942cac5dfb392327e..a7d86cbe2e5e3ef7840ebfe9e033840e7ae10760 100644 (file)
@@ -129,7 +129,7 @@ class HostDetails:
         return _cls
 
     @staticmethod
-    def yaml_representer(dumper: 'yaml.SafeDumper', data: 'HostDetails') -> Any:
+    def yaml_representer(dumper: 'yaml.Dumper', data: 'HostDetails') -> yaml.Node:
         return dumper.represent_dict(cast(Mapping, data.to_json().items()))