From: Jan Fajerski Date: Thu, 6 Aug 2020 13:56:57 +0000 (+0200) Subject: pybing/mgr/snap_schedule: guard minute repeat interval X-Git-Tag: v16.1.0~1299^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ed61ed9bbc9a9dd2eb12ded5d48ac9910001b162;p=ceph.git pybing/mgr/snap_schedule: guard minute repeat interval To enable the use of a minutely repeat interval in the snap schedules, this adds a guard that checks for the SNAP_SCHED_TEST env variable. Signed-off-by: Jan Fajerski --- diff --git a/src/pybind/mgr/snap_schedule/fs/schedule.py b/src/pybind/mgr/snap_schedule/fs/schedule.py index 59fec351a655..5b9559901441 100644 --- a/src/pybind/mgr/snap_schedule/fs/schedule.py +++ b/src/pybind/mgr/snap_schedule/fs/schedule.py @@ -6,6 +6,7 @@ LGPL2.1. See file COPYING. from datetime import datetime, timezone import json import logging +from os import environ import re import sqlite3 from typing import Tuple, Any @@ -312,7 +313,7 @@ class Schedule(object): def repeat(self): mult = self.schedule[-1] period = int(self.schedule[0:-1]) - if mult == 'M': + if 'SNAP_SCHED_TESTING' in environ and mult == 'M': return period * 60 elif mult == 'h': return period * 60 * 60