@@ -50,11 +50,11 @@ class Controller(stas.ControllerABC):
5050 def __init__ (self , tid : trid .TID , service , discovery_ctrl : bool = False ):
5151 sysconf = conf .SysConf ()
5252 self ._nvme_options = conf .NvmeOptions ()
53- self ._root = nvme .global_ctx ()
54- self ._host = nvme .host (
53+ self ._root = nvme .GlobalCtx ()
54+ self ._host = nvme .Host (
5555 self ._root , hostnqn = sysconf .hostnqn , hostid = sysconf .hostid , hostsymname = sysconf .hostsymname
5656 )
57- self ._host .dhchap_key = sysconf .hostkey if self ._nvme_options .dhchap_hostkey_supp else None
57+ self ._host .dhchap_host_key = sysconf .hostkey if self ._nvme_options .dhchap_hostkey_supp else None
5858 self ._udev = udev .UDEV
5959 self ._device = None # Refers to the nvme device (e.g. /dev/nvme[n])
6060 self ._ctrl = None # libnvme's nvme.ctrl object
@@ -93,7 +93,7 @@ def all_ops_completed(self) -> bool:
9393
9494 def connected (self ):
9595 '''@brief Return whether a connection is established'''
96- return self ._ctrl and self ._ctrl .connected ()
96+ return self ._ctrl and self ._ctrl .connected
9797
9898 def controller_id_dict (self ) -> dict :
9999 '''@brief return the controller ID as a dict.'''
@@ -218,7 +218,7 @@ def _get_cfg(self):
218218
219219 def _do_connect (self ):
220220 cfg = self ._get_cfg ()
221- self ._ctrl = nvme .ctrl (self ._root , cfg )
221+ self ._ctrl = nvme .Ctrl (self ._root , cfg )
222222
223223 self ._ctrl .discovery_ctrl = self ._discovery_ctrl
224224
@@ -330,7 +330,7 @@ def cback(controller: Controller, success: bool)
330330 logging .debug (
331331 'Controller.disconnect() - %s | %s: keep_connection=%s' , self .id , self .device , keep_connection
332332 )
333- if self ._ctrl and self ._ctrl .connected () and not keep_connection :
333+ if self ._ctrl and self ._ctrl .connected and not keep_connection :
334334 logging .info ('%s | %s - Disconnect initiated' , self .id , self .device )
335335 op = gutil .AsyncTask (self ._on_disconn_success , self ._on_disconn_fail , self ._ctrl .disconnect )
336336 op .run_async (disconnected_cb )
@@ -552,7 +552,7 @@ def _find_existing_connection(self):
552552 def _post_registration_actions (self ):
553553 if conf .SvcConf ().pleo_enabled and self ._is_ddc ():
554554 self ._get_supported_op = gutil .AsyncTask (
555- self ._on_get_supported_success , self ._on_get_supported_fail , self ._ctrl .supported_log_pages
555+ self ._on_get_supported_success , self ._on_get_supported_fail , self ._ctrl .get_supported_log_pages
556556 )
557557 self ._get_supported_op .run_async ()
558558 else :
@@ -656,10 +656,7 @@ def _on_get_supported_success(self, op_obj: gutil.AsyncTask, data):
656656 )
657657 return
658658
659- try :
660- dlp_supp_opts = data [nvme .NVME_LOG_LID_DISCOVERY ] >> 16
661- except (TypeError , IndexError ):
662- dlp_supp_opts = 0
659+ dlp_supp_opts = data [nvme .NVME_LOG_LID_DISCOVERY ] >> 16
663660
664661 logging .debug (
665662 'Dc._on_get_supported_success() - %s | %s: supported options = 0x%04X = %s' ,
0 commit comments