Skip to content
Snippets Groups Projects
Commit 89d45d39 authored by Attila Farkas's avatar Attila Farkas
Browse files

Fix default output directory

parent 5f9d8257
No related branches found
No related tags found
1 merge request!32Version 2.0.0
......@@ -11,7 +11,8 @@ CONFIGURATION_PATH: Path = CSC_PATH / "conf/configuration.yml"
FLAVORS_PATH: Path = CSC_PATH / "conf/flavors.yml"
def create(topology: Union[str, Path], output_dir: Union[str, Path],
def create(topology: Union[str, Path],
output_dir: Optional[Union[str, Path]] = None,
ansible_installed: bool = False, border_router: bool = False,
provisioning_dir: Optional[Union[str, Path]] = None,
extra_vars: Optional[Union[str, Path]] = None,
......@@ -43,7 +44,9 @@ def create(topology: Union[str, Path], output_dir: Union[str, Path],
raise ValueError(f"Invalid path to topology file \"{topology}\"")
try:
if isinstance(output_dir, str):
if output_dir is None or not output_dir:
sandbox_path: Path = topology_path.parent / "sandbox"
elif isinstance(output_dir, str):
sandbox_path: Path = Path(output_dir).resolve()
elif isinstance(output_dir, Path):
sandbox_path: Path = output_dir.resolve()
......
......@@ -34,7 +34,7 @@ args = parser.parse_args()
if args.output_dir:
output_dir: str = args.output_dir
else:
output_dir: str = "sandbox"
output_dir: str = ""
try:
creator.create(args.topology_file, output_dir, args.ansible_installed,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment