]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-detect-init: stop using platform.linux_distribution 21523/head
authorNathan Cutler <ncutler@suse.com>
Thu, 19 Apr 2018 11:21:31 +0000 (13:21 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 17 Jul 2018 15:52:28 +0000 (17:52 +0200)
commit12d94cae2a06fd2ae39379e233588be99bff91de
tree744cf9db6fcd46868d852f946d394785000a62ca
parente583acc359147800f8c82129449556540301302b
ceph-detect-init: stop using platform.linux_distribution

This commit introduces a new function, _extract_from_os_release, which is
used (only on Linux) to extract the ID and VERSION_ID fields from the
/etc/os-release file. This is sufficient to positively determine the OS
and version on these systems, and enable ceph-detect-init to correctly
return systemd on them.

The commit includes unit tests asserting that _extract_from_os_release really
extracts the strings that we expect it to, using the contents of
/etc/os-release from a number of different operating systems targeted by Ceph.

This commit is not cherry-picked because ceph-detect-init has been dropped in
master.

Fixes: http://tracker.ceph.com/issues/18163
Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/ceph-detect-init/ceph_detect_init/__init__.py
src/ceph-detect-init/tests/test_all.py