moved 2 parameters #196

Merged
muellerr merged 13 commits from move-pdu-datavar into v4.0.0-dev 2023-06-09 12:41:56 +02:00
Showing only changes of commit 49dde29847 - Show all commits

View File

@ -251,15 +251,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
int(input("Specify systemctl command type by key: ")) int(input("Specify systemctl command type by key: "))
) )
unit_name = input("Specify unit name: ") unit_name = input("Specify unit name: ")
cmd_data = bytearray([systemctl_cmd]) q.add_pus_tc(create_systemctl_cmd(systemctl_cmd, unit_name))
cmd_data.extend(unit_name.encode())
q.add_pus_tc(
create_action_cmd(
object_id=CORE_CONTROLLER_ID,
action_id=ActionId.SYSTEMCTL_CMD_EXECUTOR,
user_data=cmd_data,
)
)
elif op_code == OpCode.EXECUTE_SHELL_CMD_BLOCKING: elif op_code == OpCode.EXECUTE_SHELL_CMD_BLOCKING:
custom_cmd = input("Please specify command to execute: ") custom_cmd = input("Please specify command to execute: ")
q.add_pus_tc( q.add_pus_tc(
@ -458,6 +450,16 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str):
) )
def create_systemctl_cmd(systemctl_cmd: SystemctlCmd, unit_name: str):
cmd_data = bytearray([systemctl_cmd])
cmd_data.extend(unit_name.encode())
return create_action_cmd(
object_id=CORE_CONTROLLER_ID,
action_id=ActionId.SYSTEMCTL_CMD_EXECUTOR,
user_data=cmd_data,
)
def list_directory_base_user_data() -> bytearray: def list_directory_base_user_data() -> bytearray:
all_opt = int(input("Use all (-a) option (0/1) ?: ")) all_opt = int(input("Use all (-a) option (0/1) ?: "))
if all_opt not in [0, 1]: if all_opt not in [0, 1]: