Skip to content

Commit 04d6d07

Browse files
examples/qemu-networking/qemunetworkstrategy: fix NameErrors
Add missing imports and use correct variable names. Signed-off-by: Bastian Krause <[email protected]>
1 parent 8af37ae commit 04d6d07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/qemu-networking/qemunetworkstrategy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import attr
1818

1919
from labgrid import target_factory, step
20-
from labgrid.strategy import Strategy
20+
from labgrid.strategy import Strategy, StrategyError
2121
from labgrid.util import get_free_port
2222

2323

@@ -75,15 +75,15 @@ def update_network_service(self):
7575
networkservice.port = local_port
7676
else:
7777
networkservice.address = new_address
78-
networkserivce.port = self.__remote_port
78+
networkservice.port = self.__remote_port
7979

8080
@step(args=["state"])
8181
def transition(self, state, *, step):
8282
if not isinstance(state, Status):
8383
state = Status[state]
8484

8585
if state == Status.unknown:
86-
raise StrategyError(f"can not transition to {new_status}")
86+
raise StrategyError(f"can not transition to {state}")
8787

8888
elif self.status == state:
8989
step.skip("nothing to do")
@@ -99,4 +99,4 @@ def transition(self, state, *, step):
9999
self.target.activate(self.shell)
100100
self.update_network_service()
101101

102-
self.status = status
102+
self.status = state

0 commit comments

Comments
 (0)