The behavior of `safe-to-destroy` has changed in
432f19435523d455ecd4f386e58ee1f033cf97e2 (PR#24799) and the backend
needs to be adapted accordingly.
Fixes: http://tracker.ceph.com/issues/37290
Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
unused_osd_id = max(map(lambda e: e['osd'], osd_dump['osds'])) + 10
self._get('/api/osd/{}/safe_to_destroy'.format(unused_osd_id))
self.assertStatus(200)
- self.assertJsonBody({'safe-to-destroy': True})
+ self.assertJsonBody({
+ 'is_safe_to_destroy': True,
+ 'active': [],
+ 'missing_stats': [],
+ 'safe_to_destroy': [unused_osd_id],
+ 'stored_pgs': [],
+ })
def get_destroy_status():
self._get('/api/osd/0/safe_to_destroy')
- if 'safe-to-destroy' in self.jsonBody():
- return self.jsonBody()['safe-to-destroy']
+ if 'is_safe_to_destroy' in self.jsonBody():
+ return self.jsonBody()['is_safe_to_destroy']
return None
self.wait_until_equal(get_destroy_status, False, 10)
self.assertStatus(200)
svc_id = [svc_id]
svc_id = list(map(str, svc_id))
try:
- CephService.send_command(
+ result = CephService.send_command(
'mon', 'osd safe-to-destroy', ids=svc_id, target=('mgr', ''))
- return {'safe-to-destroy': True}
+ result['is_safe_to_destroy'] = set(result['safe_to_destroy']) == set(map(int, svc_id))
+ return result
+
except SendCommandError as e:
return {
'message': str(e),
- 'safe-to-destroy': False,
+ 'is_safe_to_destroy': False,
}
<ng-template #criticalConfirmationTpl
let-safeToDestroyResult="result"
let-actionDescription="actionDescription">
- <div *ngIf="!safeToDestroyResult['safe-to-destroy']"
+ <div *ngIf="!safeToDestroyResult['is_safe_to_destroy']"
class="danger">
- <cd-warning-panel>
- {{ safeToDestroyResult.message }}
+ <cd-warning-panel i18n>
+ The OSD is not safe to destroy!
</cd-warning-panel>
</div>
<ng-container i18n><strong>OSD {{ selection.first().id }}</strong> will be