X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c06f9023982df26ae70da45e68e6f601c66ec8e2..53d2050dc5deb0a21fb25ede46ad4194ef5f410d:/nominatim/clicmd/setup.py?ds=sidebyside diff --git a/nominatim/clicmd/setup.py b/nominatim/clicmd/setup.py index f9298aac..ca3bf40e 100644 --- a/nominatim/clicmd/setup.py +++ b/nominatim/clicmd/setup.py @@ -71,7 +71,7 @@ class SetupAll: help='Create the database but do not import any data') - def run(self, args: NominatimArgs) -> int: # pylint: disable=too-many-statements + def run(self, args: NominatimArgs) -> int: # pylint: disable=too-many-statements, too-many-branches from ..data import country_info from ..tools import database_import, refresh, postcodes, freeze from ..indexer.indexer import Indexer @@ -92,18 +92,18 @@ class SetupAll: ) + if args.prepare_database or args.continue_at is None: + LOG.warning('Creating database') + database_import.setup_database_skeleton(args.config.get_libpq_dsn(), + rouser=args.config.DATABASE_WEBUSER) + if args.prepare_database: + return 0 if args.continue_at in (None, 'import-from-file'): files = args.get_osm_file_list() if not files and not args.prepare_database: raise UsageError("No input files (use --osm-file).") - if args.prepare_database or args.continue_at is None: - LOG.warning('Creating database') - database_import.setup_database_skeleton(args.config.get_libpq_dsn(), - rouser=args.config.DATABASE_WEBUSER) - return 0 - if args.continue_at in ('import-from-file', None): # Check if the correct plugins are installed database_import.check_existing_database_plugins(args.config.get_libpq_dsn())