def apply_drivegroups(self, specs: List[DriveGroupSpec]):
return [self._apply(spec) for spec in specs]
+ def get_osdspec_affinity(self, osd_id: str) -> str:
+ return self.get('osd_metadata').get(osd_id, {}).get('osdspec_affinity', '')
+
def find_destroyed_osds(self) -> Dict[str, List[str]]:
osd_host_map: Dict[str, List[str]] = dict()
- ret, out, err = self.mon_command({
- 'prefix': 'osd tree',
- 'states': ['destroyed'],
- 'format': 'json'
- })
- if ret != 0:
- raise OrchestratorError(f"Caught error on calling 'osd tree destroyed' -> {err}")
+ try:
+ ret, out, err = self.check_mon_command({
+ 'prefix': 'osd tree',
+ 'states': ['destroyed'],
+ 'format': 'json'
+ })
+ except MonCommandFailed as e:
+ logger.exception('osd tree failed')
+ raise OrchestratorError(str(e))
try:
tree = json.loads(out)
except json.decoder.JSONDecodeError: