]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
python-common: Fix imports
authorSebastian Wagner <sebastian.wagner@suse.com>
Mon, 8 Jul 2019 08:37:51 +0000 (10:37 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 26 Jul 2019 10:00:33 +0000 (12:00 +0200)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/ansible/module.py
src/pybind/mgr/orchestrator.py
src/pybind/mgr/orchestrator_cli/module.py
src/pybind/mgr/orchestrator_cli/test_orchestrator.py
src/pybind/mgr/rook/module.py

index 3fe83eab208f88c2fd1979843d9da181a628f567..7711028e676fb559b69d067c9af5cbb1be1ca40b 100644 (file)
@@ -559,7 +559,7 @@ class Module(MgrModule, orchestrator.Orchestrator):
         If no host provided the operation affects all the host in the OSDS role
 
 
-        :param drive_group: (orchestrator.DriveGroupSpec),
+        :param drive_group: (ceph.deployment.drive_group.DriveGroupSpec),
                             Drive group with the specification of drives to use
         :param all_hosts  : (List[str]),
                             List of hosts where the OSD's must be created
index 1e20cce4a8167a37f2be6a5cc20a0d48ab0d6bb5..fe867f15601f37c007fc5ecc5d1ad5062f7a5d92 100644 (file)
@@ -18,6 +18,7 @@ from mgr_module import MgrModule, PersistentStoreDict
 from mgr_util import format_bytes
 
 try:
+    from ceph.deployment.drive_group import DriveGroupSpec
     from typing import TypeVar, Generic, List, Optional, Union, Tuple, Iterator
 
     T = TypeVar('T')
index 7583c5a52a0d62a96a40ab6193366657e9ee9cfb..a02912fc084ff932783516107ddd8510b97b4f7b 100644 (file)
@@ -8,7 +8,9 @@ except ImportError:
 
 from functools import wraps
 
-from mgr_module import MgrModule, HandleCommandResult, CLICommand
+from ceph.deployment.drive_group import DriveGroupSpec, DriveGroupValidationError, \
+    DeviceSelection
+from mgr_module import MgrModule, CLICommand, HandleCommandResult
 
 import orchestrator
 
@@ -170,7 +172,7 @@ Usage:
 
         if inbuf:
             try:
-                drive_group = orchestrator.DriveGroupSpec.from_json(json.loads(inbuf))
+                drive_group = DriveGroupSpec.from_json(json.loads(inbuf))
             except ValueError as e:
                 msg = 'Failed to read JSON input: {}'.format(str(e)) + usage
                 return HandleCommandResult(-errno.EINVAL, stderr=msg)
@@ -183,8 +185,8 @@ Usage:
                 msg = "Invalid host:device spec: '{}'".format(svc_arg) + usage
                 return HandleCommandResult(-errno.EINVAL, stderr=msg)
 
-            devs = orchestrator.DeviceSelection(paths=block_devices)
-            drive_group = orchestrator.DriveGroupSpec(node_name, data_devices=devs)
+            devs = DeviceSelection(paths=block_devices)
+            drive_group = DriveGroupSpec(node_name, data_devices=devs)
         else:
             return HandleCommandResult(-errno.EINVAL, stderr=usage)
 
@@ -197,7 +199,7 @@ Usage:
 
         try:
             drive_group.validate(all_hosts)
-        except orchestrator.DriveGroupValidationError as e:
+        except DriveGroupValidationError as e:
             return HandleCommandResult(-errno.EINVAL, stderr=str(e))
 
         completion = self.create_osds(drive_group, all_hosts)
index 834cd4d7c56c0d19d635652bd4368146fac7db88..3374d5a3ca512322cb724d79543269c5439e5a39 100644 (file)
@@ -2,8 +2,8 @@ from __future__ import absolute_import
 import pytest
 
 
-from orchestrator import DriveGroupSpec, DeviceSelection, DriveGroupValidationError, \
-    InventoryDevice, ReadCompletion, raise_if_exception
+from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection, DriveGroupValidationError
+from orchestrator import InventoryDevice, ReadCompletion, raise_if_exception
 
 
 def test_DriveGroup():
index 37d7bbb8d02b51b85d89a1ea3666236915e7975e..51c9bd1e1d164a809cccf09e14958c1e3302190e 100644 (file)
@@ -4,6 +4,7 @@ import os
 import uuid
 try:
     from typing import List
+    from ceph.deployment.drive_group import DriveGroupSpec
 except ImportError:
     pass  # just for type checking
 
@@ -412,7 +413,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
                 "Updating NFS server count in {0} to {1}".format(spec.name, num))
 
     def create_osds(self, drive_group, all_hosts):
-        # type: (orchestrator.DriveGroupSpec, List[str]) -> RookWriteCompletion
+        # type: (DriveGroupSpec, List[str]) -> RookWriteCompletion
 
         assert len(drive_group.hosts(all_hosts)) == 1
         targets = []