Merge pull request #76 from vexxhost/add-hack

feat: Add hack script
diff --git a/staffeln/conductor/backup.py b/staffeln/conductor/backup.py
index 9f3f54d..84194ad 100755
--- a/staffeln/conductor/backup.py
+++ b/staffeln/conductor/backup.py
@@ -179,8 +179,14 @@
             task.save()
 
         except OpenstackSDKException as e:
-            reason = _("Backup %s deletion failed. %s" % (task.backup_id, str(e)[:64]))
-            log_msg = _("Backup %s deletion failed. %s" % (task.backup_id, str(e)))
+            reason = _(
+                "Backup %s deletion failed. Need delete manually: %s"
+                % (task.backup_id, str(e)[:64])
+            )
+            log_msg = _(
+                "Backup %s deletion failed. Need delete manually: %s"
+                % (task.backup_id, str(e))
+            )
             LOG.warn(log_msg)
             task.reason = reason
             task.backup_status = constants.BACKUP_FAILED
@@ -231,6 +237,13 @@
         try:
             project_id = backup_object.project_id
             if project_id not in self.project_list:
+                LOG.info(
+                    _(
+                        "Project %s for backup %s is not existing in Openstack."
+                        "Start removing backup object from Staffeln."
+                        % (project_id, backup_object.backup_id)
+                    )
+                )
                 backup_object.delete_backup()
 
             self.openstacksdk.set_project(self.project_list[project_id])
@@ -242,6 +255,7 @@
                     _(
                         "Backup %s is not existing in Openstack."
                         "Or cinder-backup is not existing in the cloud."
+                        "Start removing backup object from Staffeln."
                         % backup_object.backup_id
                     )
                 )
@@ -257,6 +271,7 @@
                 LOG.warn(
                     _(
                         "Backup %s deletion failed. Need to delete manually."
+                        "Start removing backup object from Staffeln."
                         "%s" % (backup_object.backup_id, str(e))
                     )
                 )
@@ -286,6 +301,8 @@
         """
         # select * from backup order by Id DESC LIMIT 2;
         try:
+            if CONF.conductor.full_backup_depth == 0:
+                return False
             backups = self.get_backups(
                 filters={"volume_id__eq": volume_id},
                 limit=CONF.conductor.full_backup_depth,
diff --git a/staffeln/conductor/manager.py b/staffeln/conductor/manager.py
index 33ab139..62530c0 100755
--- a/staffeln/conductor/manager.py
+++ b/staffeln/conductor/manager.py
@@ -267,6 +267,7 @@
                                 self.controller.hard_remove_volume_backup(

                                     backup, skip_inc_err=True

                                 )

+                                time.sleep(2)

             except coordination.LockAcquireFailed:

                 LOG.debug("Failed to lock for retention")

 

diff --git a/staffeln/conf/conductor.py b/staffeln/conf/conductor.py
index 1032ab4..b07b956 100755
--- a/staffeln/conf/conductor.py
+++ b/staffeln/conf/conductor.py
@@ -27,7 +27,7 @@
         "report_period",
         default=1440,
         min=10,
-        help=_("The time of report period, the unit is one second."),
+        help=_("The time of report period, the unit is one minute."),
     ),
     cfg.StrOpt(
         "backup_cycle_timout",
@@ -58,7 +58,7 @@
     cfg.IntOpt(
         "full_backup_depth",
         default=2,
-        min=1,
+        min=0,
         help=_("Number of incremental backups between full backups."),
     ),
 ]