]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: update log rotation for review comments
authorGreg Farnum <gfarnum@redhat.com>
Tue, 9 Jun 2015 23:14:12 +0000 (16:14 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Tue, 9 Jun 2015 23:16:50 +0000 (16:16 -0700)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
tasks/ceph.py

index 3b9a35335364ee3026b1dedc1f7162172b2303f6..28930b8e5901615a44b526404d0c66ad510be34b 100644 (file)
@@ -72,13 +72,13 @@ def ceph_log(ctx, config):
             )
         )
 
-    class Rotater:
-        stopping = False
+    class Rotater(object):
+        stop_event = gevent.event.Event()
         def invoke_logrotate(self):
             #1) install ceph-test.conf in /etc/logrotate.d
             #2) continuously loop over logrotate invocation with ceph-test.conf
-            while not self.stopping:
-                time.sleep(30)
+            while not self.stop_event.is_set():
+                self.stop_event.wait(timeout=30)
                 run.wait(
                     ctx.cluster.run(
                         args=['sudo', 'logrotate', '/etc/logrotate.d/ceph-test.conf'