old_contents: # -*- coding: utf-8 -*-
  # vim: tabstop=4 shiftwidth=4 softtabstop=4
  #
  # Copyright (C) 2017 GEM Foundation
  #
  # OpenQuake is free software: you can redistribute it and/or modify it
  # under the terms of the GNU Affero General Public License as published
  # by the Free Software Foundation, either version 3 of the License, or
  # (at your option) any later version.
  #
  # OpenQuake is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  # GNU Affero General Public License for more details.
  #
  # You should have received a copy of the GNU Affero General Public License
  # along with OpenQuake. If not, see <http://www.gnu.org/licenses/>.
  
  from __future__ import print_function
  import os
  import sys
  from openquake.baselib import sap
  from openquake.commonlib import config
  from openquake.commonlib import logs
  from openquake.engine.utils import confirm
  from openquake.server import dbserver
  from openquake.commands.purge import purge_all
  
  
  @sap.Script
  def reset(yes):
      """
      Remove all the datastores and the database of the current user
      """
      ok = yes or confirm('Do you really want to destroy all your data? (y/n) ')
      if not ok:
          return
  
      dbpath = os.path.realpath(
          os.path.expanduser(config.get('dbserver', 'file')))
  
      # user must be able to access and write the databse file to remove it
      if os.path.isfile(dbpath) and os.access(dbpath, os.W_OK):
          if dbserver.get_status() == 'running':
              if config.flag_set('dbserver', 'multi_user'):
                  sys.exit('The oq dbserver must be stopped '
                           'before proceeding')
              else:
                  logs.dbcmd('stop')
                  print('dbserver stopped')
  
          try:
              os.remove(dbpath)
              print('Removed %s. You must re-apply any existing migration.'
                    % dbpath)
          except OSError as exc:
              print(exc, file=sys.stderr)
  
      # fast way of removing everything
      purge_all(fast=True)  # datastore of the current user
  
  reset.flg('yes', 'confirmation')
  
new_contents: # -*- coding: utf-8 -*-
  # vim: tabstop=4 shiftwidth=4 softtabstop=4
  #
  # Copyright (C) 2017 GEM Foundation
  #
  # OpenQuake is free software: you can redistribute it and/or modify it
  # under the terms of the GNU Affero General Public License as published
  # by the Free Software Foundation, either version 3 of the License, or
  # (at your option) any later version.
  #
  # OpenQuake is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  # GNU Affero General Public License for more details.
  #
  # You should have received a copy of the GNU Affero General Public License
  # along with OpenQuake. If not, see <http://www.gnu.org/licenses/>.
  
  from __future__ import print_function
  import os
  import sys
  from openquake.baselib import sap
  from openquake.commonlib import config
  from openquake.commonlib import logs
  from openquake.engine.utils import confirm
  from openquake.server import dbserver
  from openquake.commands.purge import purge_all
  
  
  @sap.Script
  def reset(yes):
      """
      Remove all the datastores and the database of the current user
      """
      ok = yes or confirm('Do you really want to destroy all your data? (y/n) ')
      if not ok:
          return
  
      dbpath = os.path.realpath(
          os.path.expanduser(config.get('dbserver', 'file')))
  
      # user must be able to access and write the databse file to remove it
      if os.path.isfile(dbpath) and os.access(dbpath, os.W_OK):
          if dbserver.get_status() == 'running':
              if config.flag_set('dbserver', 'multi_user'):
                  sys.exit('The oq dbserver must be stopped '
                           'before proceeding')
              else:
                  logs.dbcmd('stop')
                  print('dbserver stopped')
  
          try:
              os.remove(dbpath)
              print('Removed %s'
                    % dbpath)
          except OSError as exc:
              print(exc, file=sys.stderr)
  
      # fast way of removing everything
      purge_all(fast=True)  # datastore of the current user
  
  reset.flg('yes', 'confirmation')
  
subject: Remove a misleading message