change the time regex
diff --git a/staffeln/common/time.py b/staffeln/common/time.py
index 39a6fb9..02e40e1 100644
--- a/staffeln/common/time.py
+++ b/staffeln/common/time.py
@@ -5,7 +5,7 @@
DEFAULT_TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
regex = re.compile(
- r'((?P<years>\d+?)y)?((?P<months>\d+?)m)?((?P<weeks>\d+?)w)?((?P<days>\d+?)d)?((?P<hours>\d+?)h)?((?P<minutes>\d+?)min)?((?P<seconds>\d+?)s)?'
+ r'((?P<years>\d+?)y)?((?P<months>\d+?)mon)?((?P<weeks>\d+?)w)?((?P<days>\d+?)d)?((?P<hours>\d+?)h)?((?P<minutes>\d+?)min)?((?P<seconds>\d+?)s)?'
)
diff --git a/staffeln/conductor/backup.py b/staffeln/conductor/backup.py
index bf3f63e..47a4fc0 100755
--- a/staffeln/conductor/backup.py
+++ b/staffeln/conductor/backup.py
@@ -104,6 +104,7 @@
# project_id=task.project_id, backup_id=task.backup_id,
# )
conn.delete_volume_backup(task.backup_id, force=True)
+ # TODO(Alex): After delete the backup generator, need to set the volume status again
task.delete_queue()
except OpenstackResourceNotFound:
diff --git a/staffeln/conductor/manager.py b/staffeln/conductor/manager.py
index a08b3db..bfda77d 100755
--- a/staffeln/conductor/manager.py
+++ b/staffeln/conductor/manager.py
@@ -88,7 +88,6 @@
LOG.info(_("Recycle timeout format is invalid. "
"Follow <YEARS>y<MONTHS>m<WEEKS>w<DAYS>d<HOURS>h<MINUTES>min<SECONDS>s."))
time_delta_dict = xtime.parse_timedelta_string(constants.DEFAULT_BACKUP_CYCLE_TIMEOUT)
-
rto = xtime.timeago(
years=time_delta_dict["years"],
months=time_delta_dict["months"],
@@ -98,6 +97,9 @@
minutes=time_delta_dict["minutes"],
seconds=time_delta_dict["seconds"],
)
+ # print(rto.strftime(xtime.DEFAULT_TIME_FORMAT))
+ # print(self.cycle_start_time)
+ # print(self.cycle_start_time - rto)
if rto >= self.cycle_start_time:
return True
return False
diff --git a/staffeln/conf/conductor.py b/staffeln/conf/conductor.py
index 8912748..7c9c643 100755
--- a/staffeln/conf/conductor.py
+++ b/staffeln/conf/conductor.py
@@ -17,16 +17,16 @@
),
cfg.IntOpt(
"backup_service_period",
- default=60,
+ default=30,
min=10,
help=_("The time of bakup period, the unit is one minute."),
),
cfg.StrOpt(
"backup_cycle_timout",
- regex=r'((?P<years>\d+?)y)?((?P<months>\d+?)m)?((?P<weeks>\d+?)w)?((?P<days>\d+?)d)?((?P<hours>\d+?)h)?((?P<minutes>\d+?)min)?((?P<seconds>\d+?)s)?',
+ regex=r'((?P<years>\d+?)y)?((?P<months>\d+?)mon)?((?P<weeks>\d+?)w)?((?P<days>\d+?)d)?((?P<hours>\d+?)h)?((?P<minutes>\d+?)min)?((?P<seconds>\d+?)s)?',
default=constants.DEFAULT_BACKUP_CYCLE_TIMEOUT,
help=_("The duration while the backup cycle waits backups."
- "<YEARS>y<MONTHS>m<WEEKS>w<DAYS>d<HOURS>h<MINUTES>min<SECONDS>s."),
+ "<YEARS>y<MONTHS>mon<WEEKS>w<DAYS>d<HOURS>h<MINUTES>min<SECONDS>s."),
),
cfg.StrOpt(
"backup_metadata_key",
@@ -61,10 +61,10 @@
),
cfg.StrOpt(
"retention_time",
- regex=r'((?P<years>\d+?)y)?((?P<months>\d+?)m)?((?P<weeks>\d+?)w)?((?P<days>\d+?)d)?((?P<hours>\d+?)h)?((?P<minutes>\d+?)min)?((?P<seconds>\d+?)s)?',
+ regex=r'((?P<years>\d+?)y)?((?P<months>\d+?)mon)?((?P<weeks>\d+?)w)?((?P<days>\d+?)d)?((?P<hours>\d+?)h)?((?P<minutes>\d+?)min)?((?P<seconds>\d+?)s)?',
default="2w3d",
help=_("The time of retention period, the for mat is "
- "<YEARS>y<MONTHS>m<WEEKS>w<DAYS>d<HOURS>h<MINUTES>min<SECONDS>s."),
+ "<YEARS>y<MONTHS>mon<WEEKS>w<DAYS>d<HOURS>h<MINUTES>min<SECONDS>s."),
),
]