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 <rcritten@redhat.com>
Reviewed-By: Mark Reynolds <mreynolds@redhat.com>
This commit is contained in:
Rob Crittenden 2024-06-05 14:33:13 -04:00
parent 5b3735b09d
commit 584d0cecbc

View File

@ -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)