]> 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, 15 Nov 2019 14:33:45 +0000 (08:33 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 32a4b510aa93664f2beaadecedc9ce6e8e87b931)

src/pybind/mgr/crash/module.py

index 214f8df3f89a5fb20b55b0f36ec77ad324f90ed5..0b40a4445618c689646ba4fb7f4f11ca4b5dde74 100644 (file)
@@ -102,22 +102,20 @@ class Module(MgrModule):
 
         return handler(self, command, inbuf)
 
-    @staticmethod
-    def validate_crash_metadata(inbuf):
+    def time_from_string(self, timestr):
+        # drop the 'Z' timezone indication, it's always UTC
+        timestr = timestr.rstrip('Z')
+        return datetime.datetime.strptime(timestr, 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 = time_from_string(metadata['timestamp'])
+                raise AttributeError("missing '%s' field" % f)
+        time = self.time_from_string(metadata['timestamp'])
         return metadata
 
-    @staticmethod
-    def time_from_string(timestr):
-        # drop the 'Z' timezone indication, it's always UTC
-        timestr = timestr.rstrip('Z')
-        return datetime.datetime.strptime(timestr, DATEFMT)
-
     def timestamp_filter(self, f):
         """
         Filter crash reports by timestamp.