[enh] Set default backup name to a more readable format

This commit is contained in:
Jérôme Lebleu 2015-10-05 17:49:07 +02:00
parent a51e395bca
commit c16203bd2a

View file

@ -74,7 +74,7 @@ def backup_create(name=None, description=None, output_directory=None,
# Validate and define backup name # Validate and define backup name
timestamp = int(time.time()) timestamp = int(time.time())
if not name: if not name:
name = str(timestamp) name = time.strftime('%Y%m%d-%H%M%S')
if name in backup_list()['archives']: if name in backup_list()['archives']:
raise MoulinetteError(errno.EINVAL, raise MoulinetteError(errno.EINVAL,
m18n.n('backup_archive_name_exists')) m18n.n('backup_archive_name_exists'))