From 41226d0489baad4b6d3b3dc3430960d95218daf0 Mon Sep 17 00:00:00 2001 From: Lertsenem Date: Fri, 3 Jun 2016 03:38:45 +0200 Subject: [PATCH] Do not add extension to confname when user-defined If the user chose the confname, we should generate an error rather than silently change it when we find it's already taken. --- commands/add.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/commands/add.py b/commands/add.py index 64cc63e..fcc649f 100644 --- a/commands/add.py +++ b/commands/add.py @@ -109,6 +109,14 @@ def run(args, persoconf, logger): # Check the conf file name if ( confname == persoconf.metafile or confname in appmeta.files ): + + # If the confanme was user-defined, it's a serious error. + if args.confname: + logger.error( "Confname '%s' is already taken: try another one" + % confname ) + exit(1) + + # Otherwise it's cool, we just have to change the confname by ourselves logger.info( "Confname '%s' is already taken: trying another one" % confname )