#include "Mgr.h"
#include "mon/MonClient.h"
+#include "common/version.h"
#include "PyState.h"
Py_RETURN_NONE;
}
+static PyObject *
+ceph_get_version(PyObject *self, PyObject *args)
+{
+ return PyString_FromString(pretty_version_to_str().c_str());
+}
+
static PyObject*
get_counter(PyObject *self, PyObject *args)
{
"Get a performance counter"},
{"log", ceph_log, METH_VARARGS,
"Emit a (local) log message"},
+ {"get_version", ceph_get_version, METH_VARARGS,
+ "Get the ceph version of this process"},
{NULL, NULL, 0, NULL}
};
self._logger.addHandler(CPlusPlusHandler())
+ self._version = ceph_state.get_version()
+
@property
def log(self):
return self._logger
+ @property
+ def version(self):
+ return self._version
+
def notify(self, notify_type, notify_id):
"""
Called by the ceph-mgr service to notify the Python plugin