]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Add metadata with only Ceph version number and release 21095/head
authorWido den Hollander <wido@42on.com>
Wed, 28 Mar 2018 10:25:18 +0000 (12:25 +0200)
committerWido den Hollander <wido@42on.com>
Wed, 28 Mar 2018 11:40:18 +0000 (13:40 +0200)
This prevents consumers from this data to have to fully parse
and split the 'ceph_version' string which is prone to errors.

ceph_version_short only contains the version number (maj, min, patch)
and ceph_release the codename, eg, luminous.

Signed-off-by: Wido den Hollander <wido@42on.com>
src/common/util.cc
src/common/version.cc
src/common/version.h

index 51bd8b17ea9b220bf721734c59222fb4d3f332c2..af9723bbe797d734d46f5838f0be3abdd418246f 100644 (file)
@@ -196,6 +196,8 @@ void collect_sys_info(map<string, string> *m, CephContext *cct)
 {
   // version
   (*m)["ceph_version"] = pretty_version_to_str();
+  (*m)["ceph_version_short"] = ceph_version_to_str();
+  (*m)["ceph_release"] = ceph_release_to_str();
 
   // kernel info
   struct utsname u;
index 3f882a2b445e43e7c81eb13077c1de6770d977da..5da48ea3679d269079815943aab08fbb5b74ff12 100644 (file)
@@ -28,6 +28,11 @@ const char *ceph_version_to_str(void)
   return CEPH_GIT_NICE_VER;
 }
 
+const char *ceph_release_to_str(void)
+{
+  return ceph_release_name(CEPH_RELEASE);
+}
+
 const char *git_version_to_str(void)
 {
   return STRINGIFY(CEPH_GIT_VER);
index 3d9d6622ccd709f8e76d2c47b3f9efa8f8189f6b..0a84ae442e82372de80ca809e81f85322dfd5d61 100644 (file)
@@ -20,6 +20,9 @@
 // Return a string describing the Ceph version
 const char *ceph_version_to_str(void);
 
+// Return a string with the Ceph release
+const char *ceph_release_to_str(void);
+
 // Return a string describing the git version
 const char *git_version_to_str(void);