[IMP] Use builtins "exists" click feature to check if provided files
exists
This commit is contained in:
parent
7d1183b140
commit
ca53f46248
|
|
@ -0,0 +1 @@
|
|||
restoredb: Use builtins click feature to check if provided paths exist
|
||||
|
|
@ -12,7 +12,7 @@ from odoo_openupgrade_wizard.tools.tools_system import restore_filestore
|
|||
@click.option(
|
||||
"--database-path",
|
||||
required=True,
|
||||
type=click.Path(readable=True, resolve_path=True),
|
||||
type=click.Path(readable=True, resolve_path=True, exists=True),
|
||||
help="Path to the database dump relative project folder.",
|
||||
)
|
||||
@click.option(
|
||||
|
|
@ -27,7 +27,7 @@ from odoo_openupgrade_wizard.tools.tools_system import restore_filestore
|
|||
@click.option(
|
||||
"--filestore-path",
|
||||
required=True,
|
||||
type=click.Path(readable=True, resolve_path=True),
|
||||
type=click.Path(readable=True, resolve_path=True, exists=True),
|
||||
help="Path to the filestore backup.",
|
||||
)
|
||||
@click.option(
|
||||
|
|
@ -60,14 +60,6 @@ def restoredb(
|
|||
"postgresql to read to it."
|
||||
)
|
||||
|
||||
# Check db path exists
|
||||
if not database_path.exists():
|
||||
ctx.fail(f"Database path {database_path} does not exist.")
|
||||
|
||||
# Check filestore path exists
|
||||
if not filestore_path.exists():
|
||||
ctx.fail(f"Filestore path {filestore_path} does not exist.")
|
||||
|
||||
# Restore the database
|
||||
output = execute_pg_restore(
|
||||
ctx,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user