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.
master
Lertsenem 2016-06-03 03:38:45 +02:00
parent e6c4dcbdbc
commit 41226d0489
1 changed files with 8 additions and 0 deletions

View File

@ -109,6 +109,14 @@ def run(args, persoconf, logger):
# Check the conf file name # Check the conf file name
if ( confname == persoconf.metafile if ( confname == persoconf.metafile
or confname in appmeta.files ): 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" logger.info( "Confname '%s' is already taken: trying another one"
% confname ) % confname )