Commit b7c4b7bc authored by Seth Howell's avatar Seth Howell Committed by Ben Walker
Browse files

spdkcli: minor startup fixes



There are a couple of runtime errors in spdkcli that prevent it from
properly loading. One is the fact that it doesn't properly check to make
sure that specific subsystems are enabled before trying to load them.
The other is an apparently uninitialized variable in the iscsi object.

Change-Id: I458c6da71b60697b19c924308ac0e33a12f7a8a6
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/430638


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent c89b7bac
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ class UIISCSIGlobalParam(UINode):
class UIISCSIDevices(UINode):
    def __init__(self, parent):
        UINode.__init__(self, "target_nodes", parent)
        self.scsi_devices = list()
        self.refresh()

    def refresh(self):
+10 −2
Original line number Diff line number Diff line
@@ -36,7 +36,9 @@ class UIRoot(UINode):
        self._children = set([])
        UIBdevs(self)
        UILvolStores(self)
        if self.has_subsystem("vhost"):
            UIVhosts(self)
        if self.has_subsystem("nvmf"):
            UINVMf(self)
        UIISCSI(self)

@@ -421,6 +423,12 @@ class UIRoot(UINode):
    def get_iscsi_global_params(self, **kwargs):
        return rpc.iscsi.get_iscsi_global_params(self.client, **kwargs)

    def has_subsystem(self, subsystem):
        for system in rpc.subsystem.get_subsystems(self.client):
            if subsystem.lower() == system["subsystem"].lower():
                return True
        return False


class Bdev(object):
    def __init__(self, bdev_info):