]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Remove the runtime dependency on lsb_release 11875/head
authorBrad Hubbard <bhubbard@redhat.com>
Fri, 7 Oct 2016 04:51:41 +0000 (14:51 +1000)
committerLoic Dachary <ldachary@redhat.com>
Wed, 9 Nov 2016 15:20:03 +0000 (16:20 +0100)
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 <bhubbard@redhat.com>
(cherry picked from commit 8b1a57fd34cdc28ae688dcdf73fe70443e0463ac)

Conflicts:
debian/control: trivial context resolution

ceph.spec.in
debian/control
src/common/util.cc

index 9ddd75fb6664d78c8098381f6ffa2008fae1c927..c7ff7d72ca5db8cb421f65ad9664df1a3f478050 100644 (file)
@@ -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
index 3e036892a041cd96f338bf2c2863c87ae8350d6e..62c20a347f01b92fae4b104082741c3b2b96389e 100644 (file)
@@ -89,7 +89,6 @@ Depends: binutils,
          gdisk,
          grep,
          logrotate,
-         lsb-release,
          python,
          python-argparse | libpython2.7-stdlib,
          python-pkg-resources,
index 124b9b9c39e073a8c97ab510c3bdfa7b356a645d..ee4b84e87b517d82c50f42ccafbe4e4fe27f7dac 100644 (file)
@@ -150,33 +150,6 @@ static void file_values_parse(const map<string, string>& kvm, FILE *fp, map<stri
   }
 }
 
-static bool lsb_release_parse(map<string, string> *m, CephContext *cct)
-{
-  static const map<string, string> 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<string, string> *m, CephContext *cct)
 {
   static const map<string, string> kvm = {
@@ -201,8 +174,8 @@ static bool os_release_parse(map<string, string> *m, CephContext *cct)
 
 static void distro_detect(map<string, string> *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"}) {