Skip to content

Commit 243a105

Browse files
committed
always create a custom network
1 parent a99b4d2 commit 243a105

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

src/warnet/project.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ def create_warnet_project(directory: Path, check_empty: bool = False):
388388
copy_network_defaults(directory)
389389
copy_scenario_defaults(directory)
390390
copy_plugins_defaults(directory)
391-
click.echo(f"Copied network example files to {directory}/networks")
392391
click.echo(f"Created warnet project structure in {directory}")
393392
except Exception as e:
394393
click.secho(f"Error creating project: {e}", fg="red")
@@ -413,30 +412,9 @@ def new_internal(directory: Path, from_init=False):
413412
project_path = Path(os.path.expanduser(directory))
414413
create_warnet_project(project_path)
415414

416-
proj_answers = inquirer.prompt(
417-
[
418-
inquirer.Confirm(
419-
"custom_network",
420-
message=click.style(
421-
"Do you want to create a custom network?", fg="blue", bold=True
422-
),
423-
default=True,
424-
),
425-
]
426-
)
427415
custom_network_path = ""
428-
if proj_answers is None:
429-
click.secho("Setup cancelled by user.", fg="yellow")
430-
return False
431-
if proj_answers["custom_network"]:
432-
click.secho("\nGenerating custom network...", fg="yellow", bold=True)
433-
custom_network_path = inquirer_create_network(directory)
434-
else:
435-
click.echo(
436-
f"No custom network specified, see example network files in {project_path}/networks/"
437-
)
438-
click.echo("Deploy any of these networks by running:")
439-
click.echo(f" warnet deploy {project_path}/networks/<example-network-name>")
416+
click.secho("\nGenerating custom network...", fg="yellow", bold=True)
417+
custom_network_path = inquirer_create_network(directory)
440418

441419
if custom_network_path:
442420
click.echo(

test/plugin_test.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from pathlib import Path
66
from typing import Optional
77

8-
import pexpect
98
from test_base import TestBase
109

1110
from warnet.k8s import download, wait_for_pod
@@ -24,20 +23,12 @@ def __init__(self):
2423
def run_test(self):
2524
try:
2625
os.chdir(self.tmpdir)
27-
self.init_directory()
2826
self.deploy_with_plugin()
2927
self.copy_results()
3028
self.assert_hello_plugin()
3129
finally:
3230
self.cleanup()
3331

34-
def init_directory(self):
35-
self.log.info("Initializing SimLN plugin...")
36-
self.sut = pexpect.spawn("warnet init")
37-
self.sut.expect("network", timeout=10)
38-
self.sut.sendline("n")
39-
self.sut.close()
40-
4132
def deploy_with_plugin(self):
4233
self.log.info("Deploy the ln network with a SimLN plugin")
4334
results = self.warnet(f"deploy {self.network_dir}")

0 commit comments

Comments
 (0)