From 584d0cecbcb99a09b09d5698fc906b4849a7234c Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 5 Jun 2024 14:33:13 -0400 Subject: [PATCH] Use a unique task name for each backend in ipa-backup The name used to be "export_%Y_%m_%d_%H_%M_%S" so if the tasks were added within the same second the second backend would fail. Add the backend name to the task name to ensure uniqueness. export_{backend}_%Y_%m_%d_%H_%M_%S Fixes: https://pagure.io/freeipa/issue/9584 Signed-off-by: Rob Crittenden Reviewed-By: Mark Reynolds --- ipaserver/install/ipa_backup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py index f4fa73ff5..982e5dfc4 100644 --- a/ipaserver/install/ipa_backup.py +++ b/ipaserver/install/ipa_backup.py @@ -501,7 +501,8 @@ class Backup(admintool.AdminTool): ''' logger.info('Backing up %s in %s to LDIF', backend, instance) - cn = time.strftime('export_%Y_%m_%d_%H_%M_%S') + cn = 'export_{}_{}'.format( + backend, time.strftime('%Y_%m_%d_%H_%M_%S')) dn = DN(('cn', cn), ('cn', 'export'), ('cn', 'tasks'), ('cn', 'config')) ldifname = '%s-%s.ldif' % (instance, backend)