mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-22 01:31:25 +00:00
Control board client regression fixes (#1394)
* Control board client should use new FileCmds initiator * Restore informative logging, but drop to debug level * Use the correct object to call list_images()
This commit is contained in:
parent
05b9e0eb18
commit
7268084819
@ -106,8 +106,9 @@ class CtrlBoardMenuUpdateEventHandler(Observer):
|
||||
handler_function(info_object)
|
||||
except AttributeError:
|
||||
log = logging.getLogger(__name__)
|
||||
log.error(
|
||||
"Handler function not found or returned an error. Skipping.",
|
||||
log.debug(
|
||||
"Handler function [%s] not found or returned an error. Skipping.",
|
||||
str(handler_function_name),
|
||||
)
|
||||
|
||||
# noinspection PyUnusedLocal
|
||||
@ -194,7 +195,7 @@ class CtrlBoardMenuUpdateEventHandler(Observer):
|
||||
"""Method handles the rotary button press in the profile selection menu
|
||||
for selecting a profile to load."""
|
||||
if info_object is not None and "name" in info_object:
|
||||
file_cmd = FileCmds(sock_cmd=self.sock_cmd, piscsi=self.piscsi_cmd)
|
||||
file_cmd = FileCmds(piscsi=self.piscsi_cmd)
|
||||
result = file_cmd.read_config(file_name=info_object["name"])
|
||||
if result["status"] is True:
|
||||
self._menu_controller.show_message("Profile loaded!")
|
||||
|
@ -28,12 +28,7 @@ class CtrlBoardMenuBuilder(MenuBuilder):
|
||||
def __init__(self, piscsi_cmd: PiscsiCmds):
|
||||
super().__init__()
|
||||
self._piscsi_client = piscsi_cmd
|
||||
self.file_cmd = FileCmds(
|
||||
sock_cmd=piscsi_cmd.sock_cmd,
|
||||
piscsi=piscsi_cmd,
|
||||
token=piscsi_cmd.token,
|
||||
locale=piscsi_cmd.locale,
|
||||
)
|
||||
self.file_cmd = FileCmds(piscsi=piscsi_cmd)
|
||||
|
||||
def build(self, name: str, context_object=None) -> Menu:
|
||||
if name == CtrlBoardMenuBuilder.SCSI_ID_MENU:
|
||||
@ -48,7 +43,7 @@ class CtrlBoardMenuBuilder(MenuBuilder):
|
||||
return self.create_device_info_menu(context_object)
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
log.error("Provided menu name cannot be built!")
|
||||
log.debug("Provided menu name [%s] cannot be built!", name)
|
||||
|
||||
return self.create_scsi_id_list_menu(context_object)
|
||||
|
||||
@ -142,7 +137,7 @@ class CtrlBoardMenuBuilder(MenuBuilder):
|
||||
def create_images_menu(self, context_object=None):
|
||||
"""Creates a sub menu showing all the available images"""
|
||||
menu = Menu(CtrlBoardMenuBuilder.IMAGES_MENU)
|
||||
images_info = self.piscsi_cmd.list_images()
|
||||
images_info = self._piscsi_client.list_images()
|
||||
menu.add_entry("Return", {"context": self.IMAGES_MENU, "action": self.ACTION_RETURN})
|
||||
images = images_info["files"]
|
||||
sorted_images = sorted(images, key=lambda d: d["name"])
|
||||
|
@ -23,7 +23,7 @@ class Cycler:
|
||||
self._menu_controller = menu_controller
|
||||
self.sock_cmd = sock_cmd
|
||||
self.piscsi_cmd = piscsi_cmd
|
||||
self.file_cmd = FileCmds(sock_cmd=self.sock_cmd, piscsi=self.piscsi_cmd)
|
||||
self.file_cmd = FileCmds(piscsi=self.piscsi_cmd)
|
||||
self.cycle_entries = self.populate_cycle_entries()
|
||||
self.return_string = return_string
|
||||
self.return_entry = return_entry
|
||||
|
Loading…
Reference in New Issue
Block a user