]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
python-common/drive_group: handle fields outside of 'spec' even when 'spec' is provided 55962/head
authorAdam King <adking@redhat.com>
Wed, 31 May 2023 17:08:35 +0000 (13:08 -0400)
committerAdam King <adking@redhat.com>
Tue, 5 Mar 2024 14:56:01 +0000 (09:56 -0500)
commitf3594ffc5d347ba0741c3b80b592c644c557d673
treefd0dbd4e85415447be107a9b3e7499a0caf48cea
parent7b464252f50f912b6bddd9129ce15a2a898ee7de
python-common/drive_group: handle fields outside of 'spec' even when 'spec' is provided

Otherwise certain specs such as

service_type: osd
service_id: xxx
service_name: osd.xxx
placement:
  hosts:
  - vm-00
spec:
  osds_per_device: 2
data_devices:
  paths:
  - /dev/vde

fail to apply with

Error EINVAL: ServiceSpec: 'dict' object has no attribute 'validate'

which is not a useful error message. This is caused by the
spec assuming all osd specific fields are either defined
in the 'spec' section or outside of it, but not mixed in.
We could also just consider these specs to be invalid
and just raise a better error message, but it seems easier
to make the minor adjustment for it to work, given there doesn't
seem to be an issue with mixing the styles for specs for
other service types.

Fixes: https://tracker.ceph.com/issues/61533
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 12901f617d9f21dcc4de9b039b7ab6484fbc99ca)
src/python-common/ceph/deployment/drive_group.py
src/python-common/ceph/tests/test_drive_group.py