mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-28 14:34:36 +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)
|
handler_function(info_object)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
log.error(
|
log.debug(
|
||||||
"Handler function not found or returned an error. Skipping.",
|
"Handler function [%s] not found or returned an error. Skipping.",
|
||||||
|
str(handler_function_name),
|
||||||
)
|
)
|
||||||
|
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
@ -194,7 +195,7 @@ class CtrlBoardMenuUpdateEventHandler(Observer):
|
|||||||
"""Method handles the rotary button press in the profile selection menu
|
"""Method handles the rotary button press in the profile selection menu
|
||||||
for selecting a profile to load."""
|
for selecting a profile to load."""
|
||||||
if info_object is not None and "name" in info_object:
|
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"])
|
result = file_cmd.read_config(file_name=info_object["name"])
|
||||||
if result["status"] is True:
|
if result["status"] is True:
|
||||||
self._menu_controller.show_message("Profile loaded!")
|
self._menu_controller.show_message("Profile loaded!")
|
||||||
|
@ -28,12 +28,7 @@ class CtrlBoardMenuBuilder(MenuBuilder):
|
|||||||
def __init__(self, piscsi_cmd: PiscsiCmds):
|
def __init__(self, piscsi_cmd: PiscsiCmds):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._piscsi_client = piscsi_cmd
|
self._piscsi_client = piscsi_cmd
|
||||||
self.file_cmd = FileCmds(
|
self.file_cmd = FileCmds(piscsi=piscsi_cmd)
|
||||||
sock_cmd=piscsi_cmd.sock_cmd,
|
|
||||||
piscsi=piscsi_cmd,
|
|
||||||
token=piscsi_cmd.token,
|
|
||||||
locale=piscsi_cmd.locale,
|
|
||||||
)
|
|
||||||
|
|
||||||
def build(self, name: str, context_object=None) -> Menu:
|
def build(self, name: str, context_object=None) -> Menu:
|
||||||
if name == CtrlBoardMenuBuilder.SCSI_ID_MENU:
|
if name == CtrlBoardMenuBuilder.SCSI_ID_MENU:
|
||||||
@ -48,7 +43,7 @@ class CtrlBoardMenuBuilder(MenuBuilder):
|
|||||||
return self.create_device_info_menu(context_object)
|
return self.create_device_info_menu(context_object)
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
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)
|
return self.create_scsi_id_list_menu(context_object)
|
||||||
|
|
||||||
@ -142,7 +137,7 @@ class CtrlBoardMenuBuilder(MenuBuilder):
|
|||||||
def create_images_menu(self, context_object=None):
|
def create_images_menu(self, context_object=None):
|
||||||
"""Creates a sub menu showing all the available images"""
|
"""Creates a sub menu showing all the available images"""
|
||||||
menu = Menu(CtrlBoardMenuBuilder.IMAGES_MENU)
|
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})
|
menu.add_entry("Return", {"context": self.IMAGES_MENU, "action": self.ACTION_RETURN})
|
||||||
images = images_info["files"]
|
images = images_info["files"]
|
||||||
sorted_images = sorted(images, key=lambda d: d["name"])
|
sorted_images = sorted(images, key=lambda d: d["name"])
|
||||||
|
@ -23,7 +23,7 @@ class Cycler:
|
|||||||
self._menu_controller = menu_controller
|
self._menu_controller = menu_controller
|
||||||
self.sock_cmd = sock_cmd
|
self.sock_cmd = sock_cmd
|
||||||
self.piscsi_cmd = piscsi_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.cycle_entries = self.populate_cycle_entries()
|
||||||
self.return_string = return_string
|
self.return_string = return_string
|
||||||
self.return_entry = return_entry
|
self.return_entry = return_entry
|
||||||
|
Loading…
x
Reference in New Issue
Block a user