Commit 21ec88d2 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

nabu-config: Force absolute dataset path

parent f6b33baf
......@@ -2,7 +2,6 @@ from os import path
from .utils import parse_params_values
from .cli_configs import BootstrapConfig
from ...io.config import generate_nabu_configfile
from ..validators import convert_to_bool
def parse_sections(sections):
sections = sections.lower()
......@@ -38,11 +37,18 @@ def bootstrap():
prefilled_values = {}
if args["dataset"] != "":
prefilled_values["dataset"] = {}
prefilled_values["dataset"]["location"] = args["dataset"]
user_dataset = args["dataset"]
if not path.isabs(user_dataset):
user_dataset = path.abspath(user_dataset)
print("Warning: using absolute dataset path %s" % user_dataset)
if not path.exists(user_dataset):
print("Error: cannot find the file or directory %s" % user_dataset)
exit(1)
prefilled_values["dataset"]["location"] = user_dataset
generate_nabu_configfile(
args["output"],
comments=not(no_comments),
options_level=args["level"],
prefilled_values=prefilled_values,
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment