Skip to content

Commit

Permalink
fixup error message when config dir already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
willcl-ark committed Jan 18, 2024
1 parent 2ed7514 commit 7ece2ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/warnet/cli/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ def start(graph_file: Path, force: bool, network: str):
"network_from_file",
{"graph_file": encoded_graph_file, "force": force, "network": network},
)
print_repr(result)
# It's a warnet
if type(result) == dict:
print_repr(result)
else:
print(result)
except Exception as e:
print(f"Error creating network: {e}")

Expand Down
3 changes: 2 additions & 1 deletion src/warnet/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def scenarios_list(self) -> List[tuple]:
scenario_list.append((s.name, m.cli_help()))
return scenario_list
except Exception as e:
return [f"Exception {e}"]
return [(f"Exception {e}", )]

def scenarios_run(
self, scenario: str, additional_args: List[str], network: str = "warnet"
Expand Down Expand Up @@ -306,6 +306,7 @@ def network_from_file(
"""
Run a warnet with topology loaded from a <graph_file>
"""
import pdb; pdb.set_trace()
config_dir = gen_config_dir(network)
if config_dir.exists():
if force:
Expand Down

0 comments on commit 7ece2ae

Please sign in to comment.