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
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')
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
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)
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)
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)
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():
import uuid
try:
from typing import List
+ from ceph.deployment.drive_group import DriveGroupSpec
except ImportError:
pass # just for type checking
"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 = []