]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
make check fixes
authorSebastian Wagner <sebastian.wagner@suse.com>
Mon, 16 Sep 2019 13:41:07 +0000 (15:41 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 27 Nov 2019 12:38:20 +0000 (13:38 +0100)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/ansible/ansible_runner_svc.py
src/pybind/mgr/ansible/module.py
src/pybind/mgr/tests/test_orchestrator.py

index 116136c6153034f4301e4c93acef481b5c0a800e..70355eab2bf120eaf40cfa612c2760367cfcc7b0 100644 (file)
@@ -7,7 +7,10 @@ import re
 from functools import wraps
 import collections
 import logging
-from typing import Optional
+try:
+    from typing import Optional
+except ImportError:
+    pass # just for type checking
 
 import requests
 from orchestrator import OrchestratorError
index 05c86214c673b51b3800d34e6d870995ac5bf59e..ba58cecb90b7dafdbfd329789609be56d780a0a9 100644 (file)
@@ -10,8 +10,12 @@ import json
 import os
 import errno
 import tempfile
-from typing import List, Any, Optional, Callable, Tuple, TypeVar
-T = TypeVar('T')
+
+try:
+    from typing import List, Optional, Callable
+except ImportError:
+    pass # just for type checking
+
 
 import requests
 
@@ -66,7 +70,7 @@ URL_GET_HOSTS = "api/v1/hosts"
 
 
 def deferred(f):
-    # type: (Callable[..., T]) -> Callable[..., orchestrator.Completion[T]]
+    # type: (Callable) -> Callable[..., orchestrator.Completion]
     """
     Decorator to make RookOrchestrator methods return
     a completion object that executes themselves.
index ff4d71ca0dc00060dc1b246dd5087401130f14b6..fb4dd3e56c05fc4aba332c95f8318cb527a16051 100644 (file)
@@ -1,6 +1,11 @@
 from __future__ import absolute_import
 import json
-from unittest.mock import MagicMock
+
+try:
+    from unittest.mock import MagicMock
+except ImportError:
+    # py2
+    from mock import MagicMock
 
 import pytest