From 91c148c506ff2add2672390f9b99e577746a1dda Mon Sep 17 00:00:00 2001 From: gbenhaim Date: Sun, 1 Apr 2018 12:31:11 +0300 Subject: [PATCH] Allow to create a workdir in an existing dir Ther is no reason to fail 'lago init' if a user want to create the workdir in an existing directory. Signed-off-by: gbenhaim --- lago/cmd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lago/cmd.py b/lago/cmd.py index bfbe4e60..06bc0de8 100755 --- a/lago/cmd.py +++ b/lago/cmd.py @@ -148,7 +148,10 @@ def do_init( with log_utils.LogTask('Initialize and populate prefix', LOGGER): LOGGER.debug('Using workdir %s', workdir) workdir = lago_workdir.Workdir(workdir) - if not os.path.exists(workdir.path): + if not ( + os.path.exists(workdir.path) + and lago.workdir.Workdir.is_workdir(workdir.path) + ): LOGGER.debug( 'Initializing workdir %s with prefix %s', workdir.path,