From: Brad Hubbard Date: Fri, 7 Oct 2016 04:51:41 +0000 (+1000) Subject: common: Remove the runtime dependency on lsb_release X-Git-Tag: v10.2.6~36^2~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=66a19a8fc12698a3a32a7a8f9a4bc7dea711dca1;p=ceph.git common: Remove the runtime dependency on lsb_release With modern releases we should be able to make do with the call to os_release_parse only which uses /etc/os-release which should be available on most (all?) releases we currently support. this then allows us to remove the runtime dependency which pulls in several other packages and would be nice to avoid. Fixes: http://tracker.ceph.com/issues/17425 Signed-off-by: Brad Hubbard (cherry picked from commit 8b1a57fd34cdc28ae688dcdf73fe70443e0463ac) Conflicts: debian/control: trivial context resolution --- diff --git a/ceph.spec.in b/ceph.spec.in index 9ddd75fb6664..c7ff7d72ca5d 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -216,12 +216,8 @@ Requires: cryptsetup Requires: findutils Requires: which %if 0%{?suse_version} -Requires: lsb-release Recommends: ntp-daemon %endif -%if 0%{?fedora} || 0%{?rhel} -Requires: redhat-lsb-core -%endif %if 0%{with xio} Requires: libxio %endif diff --git a/debian/control b/debian/control index 3e036892a041..62c20a347f01 100644 --- a/debian/control +++ b/debian/control @@ -89,7 +89,6 @@ Depends: binutils, gdisk, grep, logrotate, - lsb-release, python, python-argparse | libpython2.7-stdlib, python-pkg-resources, diff --git a/src/common/util.cc b/src/common/util.cc index 124b9b9c39e0..ee4b84e87b51 100644 --- a/src/common/util.cc +++ b/src/common/util.cc @@ -150,33 +150,6 @@ static void file_values_parse(const map& kvm, FILE *fp, map *m, CephContext *cct) -{ - static const map kvm = { - { "distro", "Distributor ID:" }, - { "distro_description", "Description:" }, - { "distro_codename", "Codename:", }, - { "distro_version", "Release:" } - }; - - FILE *fp = popen("lsb_release -idrc", "r"); - if (!fp) { - int ret = -errno; - lderr(cct) << "lsb_release_parse - failed to call lsb_release binary with error: " << cpp_strerror(ret) << dendl; - return false; - } - - file_values_parse(kvm, fp, m, cct); - - if (pclose(fp)) { - int ret = -errno; - lderr(cct) << "lsb_release_parse - pclose failed: " << cpp_strerror(ret) << dendl; - return false; - } - - return true; -} - static bool os_release_parse(map *m, CephContext *cct) { static const map kvm = { @@ -201,8 +174,8 @@ static bool os_release_parse(map *m, CephContext *cct) static void distro_detect(map *m, CephContext *cct) { - if (!lsb_release_parse(m, cct) && !os_release_parse(m, cct)) { - lderr(cct) << "distro_detect - lsb_release or /etc/os-release is required" << dendl; + if (!os_release_parse(m, cct)) { + lderr(cct) << "distro_detect - /etc/os-release is required" << dendl; } for (const char* rk: {"distro", "distro_version"}) {