class HostAssignment(object):
def __init__(self,
- spec, # type: ServiceSpec
+ spec: ServiceSpec,
hosts: List[orchestrator.HostSpec],
unreachable_hosts: List[orchestrator.HostSpec],
draining_hosts: List[orchestrator.HostSpec],
daemons: List[orchestrator.DaemonDescription],
networks: Dict[str, Dict[str, Dict[str, List[str]]]] = {},
- filter_new_host=None, # type: Optional[Callable[[str],bool]]
+ filter_new_host: Optional[Callable[[str], bool]] = None,
allow_colo: bool = False,
primary_daemon_type: Optional[str] = None,
per_host_daemon_type: Optional[str] = None,
yield m
-def wait(m, c):
- # type: (CephadmOrchestrator, OrchResult) -> Any
+def wait(m: CephadmOrchestrator, c: OrchResult) -> Any:
return raise_if_exception(c)
# fallback to normal sort
natsorted = sorted # type: ignore
-from ceph.deployment.inventory import Device
+from ceph.deployment.inventory import Device # noqa: F401; pylint: disable=unused-variable
from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection, OSDMethod
from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, service_spec_allow_invalid_from_json, TracingSpec
from ceph.deployment.hostspec import SpecValidationError
def __init__(self, *args: Any, **kwargs: Any) -> None:
super(OrchestratorCli, self).__init__(*args, **kwargs)
- self.ident = set() # type: Set[str]
- self.fault = set() # type: Set[str]
+ self.ident: Set[str] = set()
+ self.fault: Set[str] = set()
self._load()
self._refresh_health()
pg_summary = self.get('pg_summary')
for pool in pg_summary['by_pool']:
- num_by_state = defaultdict(int) # type: DefaultDict[str, int]
+ num_by_state: DefaultDict[str, int] = defaultdict(int)
for state_name, count in pg_summary['by_pool'][pool].items():
for state in state_name.split('+'):