import subprocess
from ceph.deployment import inventory, translate
-from ceph.deployment.drive_group import DriveGroupSpecs
+from ceph.deployment.drive_group import DriveGroupSpec
from ceph.deployment.drive_selection import selector
from mgr_module import MgrModule
return self.get_inventory().then(call_create)
def create_osds(self, drive_groups):
+ # type: (List[DriveGroupSpec]) -> AsyncCompletion
return self.get_hosts().then(lambda hosts: self.call_inventory(hosts, drive_groups))
def _prepare_deployment(self,
all_hosts, # type: List[orchestrator.InventoryNode]
- drive_groups, # type: List[DriveGroupSpecs]
+ drive_groups, # type: List[DriveGroupSpec]
inventory_list # type: List[orchestrator.InventoryNode]
):
# type: (...) -> orchestrator.Completion
raise NotImplementedError()
def create_osds(self, drive_groups):
- # type: (DriveGroupSpec) -> Completion
+ # type: (List[DriveGroupSpec]) -> Completion
"""
Create one or more OSDs within a single Drive Group.
pytest-cov==2.7.1
mock; python_version <= '3.3'
ipaddress; python_version < '3.3'
-../../python-common
+-e../../python-common
kubernetes
requests-mock
pyyaml
drive_group = drive_groups[0]
targets = [] # type: List[str]
- if drive_group.data_devices:
- targets += drive_group.data_devices.paths
+ if drive_group.data_devices and drive_group.data_devices.paths:
+ targets += [d.path for d in drive_group.data_devices.paths]
if drive_group.data_directories:
targets += drive_group.data_directories
return orchestrator.Completion.with_progress(
message="Creating OSD on {0}:{1}".format(
- drive_group.hosts(drive_group.host_pattern),
+ drive_group.hosts(all_hosts),
targets),
mgr=self,
on_complete=lambda _:self.rook_cluster.add_osds(drive_group, all_hosts),
Rook currently (0.8) can only do single-drive OSDs, so we
treat all drive groups as just a list of individual OSDs.
"""
- block_devices = drive_group.data_devices.paths if drive_group.data_devices else None
+ block_devices = drive_group.data_devices.paths if drive_group.data_devices else []
directories = drive_group.data_directories
assert drive_group.objectstore in ("bluestore", "filestore")
if drive_group.hosts(all_hosts)[0] not in [n['name'] for n in current_nodes]:
pd = { "name": drive_group.hosts(all_hosts)[0],
- "config": { "storeType": drive_group.objectstore }}
+ "config": { "storeType": drive_group.objectstore }} # type: dict
if block_devices:
pd["devices"] = [{'name': d.path} for d in block_devices]
def __init__(self, drive_group_json):
# type: (dict) -> None
self.drive_group_json = drive_group_json
- self.drive_groups = list() # type: list
+ self.drive_groups = list() # type: List[DriveGroupSpec]
self.build_drive_groups()
def build_drive_groups(self):
device_id=None, # type: Optional[str]
):
self.path = path
- self.sys_api = sys_api
+ self.sys_api = sys_api if sys_api is not None else {} # type: Dict[str, Any]
self.available = available
- self.rejected_reasons = rejected_reasons
+ self.rejected_reasons = rejected_reasons if rejected_reasons is not None else []
self.lvs = lvs
self.device_id = device_id
--- /dev/null
+# Marker file for PEP 561. This package uses inline types.
\ No newline at end of file