[cwctl] upgrade: do delete the static data dir if verbosity is 0 (closes #17069749)

authorDavid Douard <david.douard@logilab.fr>
changesete3779004e987
branch3.24
phasedraft
hiddenno
parent revision#e282711ac6b2 Added tag 3.24.7, debian/3.24.7-1, centos/3.24.7-1 for changeset 58f1e8545a77
child revision#7c7d58cc5c1f [cwctl] do only clean static data dir content (closes #17069762)
files modified by this revision
cubicweb/web/webctl.py
# HG changeset patch
# User David Douard <david.douard@logilab.fr>
# Date 1491295849 -7200
# Tue Apr 04 10:50:49 2017 +0200
# Branch 3.24
# Node ID e3779004e987e9b9d8cd5e8b6f45de30280eeeab
# Parent e282711ac6b25cf08eb4bbdd83e4779211735027
[cwctl] upgrade: do delete the static data dir if verbosity is 0 (closes #17069749)

diff --git a/cubicweb/web/webctl.py b/cubicweb/web/webctl.py
@@ -63,11 +63,11 @@
1          if not dest:
2              dest = config['staticdir-path']
3          if not dest:
4              dest = osp.join(config.appdatahome, 'data')
5          if osp.exists(dest):
6 -            if (not ask_clean or
7 +            if config.verbosity and (not ask_clean or
8                  not (config.verbosity and
9                       ASK.confirm('Remove existing data directory %s?' % dest))):
10                  raise ExecutionError('Directory %s already exists. '
11                                       'Remove it first.' % dest)
12              rmtree(dest)