-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove state from state machine dict - UnixRemote conditionally delet…
…es PROXY_PC (#547) * Remove state from state machine dict * upload-artifact@v4 * fix * delte transitions * tuple annotations * start dev unixremote3 * dev * dev * style * rd * tests * test * t2 * fix formattig * warning * warning * review#2 * after review
- Loading branch information
1 parent
3be2085
commit a40c5f0
Showing
10 changed files
with
1,110 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
""" | ||
|
||
__author__ = 'Grzegorz Latuszek, Marcin Usielski, Michal Ernst' | ||
__copyright__ = 'Copyright (C) 2018-2019, Nokia' | ||
__copyright__ = 'Copyright (C) 2018-2024, Nokia' | ||
__email__ = '[email protected], [email protected], [email protected]' | ||
|
||
from moler.device.proxy_pc import ProxyPc | ||
|
@@ -25,41 +25,41 @@ class UnixRemote(ProxyPc): | |
Example of device in yaml configuration file: | ||
- with PROXY_PC: | ||
UNIX_1: | ||
DEVICE_CLASS: moler.device.unixremote.UnixRemote | ||
CONNECTION_HOPS: | ||
PROXY_PC: | ||
UNIX_REMOTE: | ||
execute_command: ssh # default value | ||
command_params: | ||
expected_prompt: unix_remote_prompt | ||
host: host_ip | ||
login: login | ||
password: password | ||
UNIX_REMOTE: | ||
PROXY_PC: | ||
execute_command: exit # default value | ||
command_params: | ||
expected_prompt: proxy_pc_prompt | ||
UNIX_LOCAL: | ||
PROXY_PC: | ||
execute_command: ssh # default value | ||
command_params: | ||
expected_prompt: proxy_pc_prompt | ||
host: host_ip | ||
login: login | ||
password: password | ||
DEVICE_CLASS: moler.device.unixremote.UnixRemote | ||
CONNECTION_HOPS: | ||
PROXY_PC: | ||
UNIX_REMOTE: | ||
execute_command: ssh # default value | ||
command_params: | ||
expected_prompt: unix_remote_prompt | ||
host: host_ip | ||
login: login | ||
password: password | ||
UNIX_REMOTE: | ||
PROXY_PC: | ||
execute_command: exit # default value | ||
command_params: | ||
expected_prompt: proxy_pc_prompt | ||
UNIX_LOCAL: | ||
PROXY_PC: | ||
execute_command: ssh # default value | ||
command_params: | ||
expected_prompt: proxy_pc_prompt | ||
host: host_ip | ||
login: login | ||
password: password | ||
-without PROXY_PC: | ||
UNIX_1: | ||
DEVICE_CLASS: moler.device.unixremote.UnixRemote | ||
CONNECTION_HOPS: | ||
UNIX_LOCAL: | ||
UNIX_REMOTE: | ||
execute_command: ssh # default value | ||
command_params: | ||
expected_prompt: unix_remote_prompt | ||
host: host_ip | ||
login: login | ||
password: password | ||
DEVICE_CLASS: moler.device.unixremote.UnixRemote | ||
CONNECTION_HOPS: | ||
UNIX_LOCAL: | ||
UNIX_REMOTE: | ||
execute_command: ssh # default value | ||
command_params: | ||
expected_prompt: unix_remote_prompt | ||
host: host_ip | ||
login: login | ||
password: password | ||
""" | ||
|
@@ -417,7 +417,6 @@ def _prepare_state_hops_without_proxy_pc(self): | |
UnixRemote.not_connected: UnixRemote.unix_remote, | ||
UnixRemote.unix_local: UnixRemote.unix_remote, | ||
UnixRemote.unix_local_root: UnixRemote.unix_remote, | ||
UnixRemote.proxy_pc: UnixRemote.unix_remote, | ||
} | ||
} | ||
return state_hops | ||
|
@@ -429,7 +428,12 @@ def _configure_state_machine(self, sm_params): | |
:return: None. | ||
""" | ||
super(UnixRemote, self)._configure_state_machine(sm_params) | ||
self._overwrite_prompts() | ||
|
||
def _overwrite_prompts(self): | ||
""" | ||
Overwrite prompts for some states to easily configure the SM. | ||
""" | ||
if self._use_proxy_pc: | ||
self._configurations[UnixRemote.connection_hops][UnixRemote.unix_remote_root][UnixRemote.unix_remote][ | ||
"command_params"]["expected_prompt"] = \ | ||
|
Oops, something went wrong.