]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/crash: don't make these methods static
authorSage Weil <sage@redhat.com>
Wed, 17 Jul 2019 22:00:57 +0000 (17:00 -0500)
committerSage Weil <sage@redhat.com>
Fri, 19 Jul 2019 19:45:47 +0000 (14:45 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/crash/module.py

index d825dcffed475e3e99cd9135479b43563e3911e4..d8fd7bbc19aa1099569ad9250648611f530b0ab1 100644 (file)
@@ -103,18 +103,7 @@ class Module(MgrModule):
 
         return handler(self, command, inbuf)
 
-    @staticmethod
-    def validate_crash_metadata(inbuf):
-        # raise any exceptions to caller
-        metadata = json.loads(inbuf)
-        for f in ['crash_id', 'timestamp']:
-            if f not in metadata:
-                raise AttributeError("missing '%s' field" % (f))
-        time = time_from_string(metadata['timestamp'])
-        return metadata
-
-    @staticmethod
-    def time_from_string(timestr):
+    def time_from_string(self, timestr):
         # drop the 'Z' timezone indication, it's always UTC
         timestr = timestr.rstrip('Z')
         try:
@@ -122,6 +111,15 @@ class Module(MgrModule):
         except ValueError:
             return datetime.datetime.strptime(timestr, OLD_DATEFMT)
 
+    def validate_crash_metadata(self, inbuf):
+        # raise any exceptions to caller
+        metadata = json.loads(inbuf)
+        for f in ['crash_id', 'timestamp']:
+            if f not in metadata:
+                raise AttributeError("missing '%s' field" % f)
+        time = self.time_from_string(metadata['timestamp'])
+        return metadata
+
     def timestamp_filter(self, f):
         """
         Filter crash reports by timestamp.