Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacific: ceph-volume: fix simple scan #47377

Closed
wants to merge 1 commit into from

Conversation

adk3798
Copy link
Contributor

@adk3798 adk3798 commented Jul 31, 2022

backport tracker: https://tracker.ceph.com/issues/56982


backport of #47361
parent tracker: https://tracker.ceph.com/issues/56969

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

When the class `Device` is instantiated with a path instead of a
block device, it fails like following.

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/ceph_volume/util/device.py", line 130, in __init__
    self._parse()
  File "/usr/lib/python3.6/site-packages/ceph_volume/util/device.py", line 233, in _parse
    self.ceph_device = disk.has_bluestore_label(self.path)
  File "/usr/lib/python3.6/site-packages/ceph_volume/util/disk.py", line 906, in has_bluestore_label
    with open(device_path, "rb") as fd:
IsADirectoryError: [Errno 21] Is a directory: '/var/lib/ceph/osd/ceph-0/'
```

passing a path instead of a block device is valid, `simple scan` needs it.

Fixes: https://tracker.ceph.com/issues/56969

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 5a10e3e)

Conflicts:
	src/ceph-volume/ceph_volume/tests/util/test_disk.py
@adk3798 adk3798 requested a review from a team as a code owner July 31, 2022 18:39
@adk3798 adk3798 added this to the pacific milestone Jul 31, 2022
@adk3798
Copy link
Contributor Author

adk3798 commented Jul 31, 2022

@guits there was a minor merge conflict in src/ceph-volume/ceph_volume/tests/util/test_disk.py. It looked straightforward to resolve but you should probably give it a quick look anyhow.

@github-actions
Copy link

github-actions bot commented Aug 8, 2022

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@guits guits closed this Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants