be.shellcmd: Support cmd.xxx options in --be-opts

Allow to override the default shell commands used to start and stop
the machine with custom commands, as in

   --be-opts="cmd.request-power-on='/usr/bin/power.sh something'"

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2023-06-12 15:33:13 +02:00
commit dcb3fc3cab

View file

@ -19,6 +19,9 @@ class Machine(MachineBase): # export
'request-power-on': "jw-switch-allesnix.sh on",
'cleanup' : None
}
for key in self.__cmds.keys():
if 'cmd.' + key in env.be_opts.keys():
self.__cmds[key] = env.be_opts['cmd.' + key]
async def __run(self, phase):
cmd = None