]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: replace instances of remoto/execnet with asyncssh 42051/head
authorMelissa <li.melissa.kun@gmail.com>
Wed, 21 Jul 2021 03:46:41 +0000 (23:46 -0400)
committerMelissa Li <li.melissa.kun@gmail.com>
Fri, 20 Aug 2021 18:27:46 +0000 (14:27 -0400)
Fixes: https://tracker.ceph.com/issues/44676
Signed-off-by: Melissa Li <li.melissa.kun@gmail.com>
ceph.spec.in
src/cephadm/cephadm
src/mypy.ini
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/requirements.txt

index b12a56c57486cf558f23eec7b4812fa62e36b04f..06ab52f1e8f196dffc0522435d7384f5d30fa651 100644 (file)
@@ -672,7 +672,7 @@ BuildArch:  noarch
 Group:          System/Filesystems
 %endif
 Requires:       ceph-mgr = %{_epoch_prefix}%{version}-%{release}
-Requires:       python%{python3_pkgversion}-remoto
+Requires:       python%{python3_pkgversion}-asyncssh
 Requires:       cephadm = %{_epoch_prefix}%{version}-%{release}
 %if 0%{?suse_version}
 Requires:       openssh
index c9da423918cb995fceab8d369b0d34844a3b75ed..81baa4d8f0aa7d82f25f9d26e2d84cf99c15acfd 100755 (executable)
@@ -7577,7 +7577,7 @@ WantedBy=ceph-{fsid}.target
             with open(os.open(os.path.join(self.daemon_path, filename), os.O_CREAT | os.O_WRONLY, mode=0o600), 'w') as f:
                 f.write(config[filename])
 
-        # When __file__ is <stdin> we're being invoked over remoto via the orchestrator, so
+        # When __file__ is <stdin> we're being invoked over asyncssh via the orchestrator, so
         # we pick up the file from where the orchestrator placed it - otherwise we'll
         # copy it to the binary location for this cluster
         if not __file__ == '<stdin>':
index 89a80afa9c7eb262e7fd47e6e049002407d43b7b..63829faa8738a8b36385116a1f4ced615c418050 100755 (executable)
@@ -36,10 +36,7 @@ ignore_missing_imports = True
 [mypy-urllib3.*]
 ignore_missing_imports = True
 
-[mypy-execnet.*]
-ignore_missing_imports = True
-
-[mypy-remoto.*]
+[mypy-asyncssh.*]
 ignore_missing_imports = True
 
 [mypy-kubernetes.*]
index b278cc54b87f98e79624df526ab7f9f68ab34da7..445c95f63959f4056be8371f40920ae8097e2bab 100644 (file)
@@ -62,20 +62,10 @@ from .utils import CEPH_IMAGE_TYPES, forall_hosts, cephadmNoImage
 from .configchecks import CephadmConfigChecks
 
 try:
-    import remoto
-    # NOTE(mattoliverau) Patch remoto until remoto PR
-    # (https://github.com/alfredodeza/remoto/pull/56) lands
-    from distutils.version import StrictVersion
-    if StrictVersion(remoto.__version__) <= StrictVersion('1.2'):
-        def remoto_has_connection(self: Any) -> bool:
-            return self.gateway.hasreceiver()
-
-        from remoto.backends import BaseConnection
-        BaseConnection.has_connection = remoto_has_connection
-    import remoto.process
+    import asyncssh
 except ImportError as e:
-    remoto = None
-    remoto_import_error = str(e)
+    asyncssh = None
+    asyncssh_import_error = str(e)
 
 logger = logging.getLogger(__name__)
 
@@ -648,11 +638,11 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
 
     @staticmethod
     def can_run() -> Tuple[bool, str]:
-        if remoto is not None:
+        if asyncssh is not None:
             return True, ""
         else:
-            return False, "loading remoto library:{}".format(
-                remoto_import_error)
+            return False, "loading asyncssh library:{}".format(
+                asyncssh_import_error)
 
     def available(self) -> Tuple[bool, str, Dict[str, Any]]:
         """
index 915b93b7c5d532d78bf1caf7dd54d756fecaa22b..a10c6a660aae9d268e95ac45833c5c303e32f820 100644 (file)
@@ -3,12 +3,7 @@ import json
 import logging
 import uuid
 from collections import defaultdict
-from typing import TYPE_CHECKING, Optional, List, cast, Dict, Any, Union, Tuple, Iterator
-try:
-    import remoto
-    import execnet.gateway_bootstrap
-except ImportError:
-    remoto = None
+from typing import TYPE_CHECKING, Optional, List, cast, Dict, Any, Union, Tuple
 
 from ceph.deployment import inventory
 from ceph.deployment.drive_group import DriveGroupSpec
index 88b9c1b855b9e1dca13ee0a348cba8360c43c6c7..ccc3b1f414f78903ec10f88349d896bcd3118cc6 100644 (file)
@@ -5,7 +5,6 @@ requests-mock
 pyyaml
 prettytable
 pyOpenSSL
-execnet
-remoto
 Jinja2
 pyfakefs
+asyncssh