Skip to content

Commit 85421e3

Browse files
committed
Bug fix: instance ID specified in netlab down could be an int
1 parent b09a7a9 commit 85421e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

netsim/cli/down.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,14 @@ def stop_all(topology: Box, args: argparse.Namespace) -> None:
175175
Find a lab instance and change directory so the rest of the shutdown
176176
process works from that directory
177177
"""
178-
def change_lab_instance(instance: str) -> None:
178+
def change_lab_instance(instance: typing.Union[int,str]) -> None:
179179
topology = _read.system_defaults()
180180
lab_states = status.read_status(topology)
181+
try: # Maybe the instance is an integer?
182+
instance = int(instance)
183+
except:
184+
pass
185+
181186
if not instance in lab_states:
182187
log.fatal(f'Unknown instance {instance}, use "netlab status --all" to display running instances')
183188

0 commit comments

Comments
 (0)