From: Christoph Hellwig Date: Wed, 23 May 2018 07:31:58 +0000 (+0200) Subject: Revert "nvmetcli: expose nvmet port status and state" X-Git-Tag: v0.7~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e926868d78a6f03d6637190b31c651f6dc395ddf;p=users%2Fhch%2Fnvmetcli.git Revert "nvmetcli: expose nvmet port status and state" This reverts commit 54ce6d02112f267733402735b1dbb3635dfa8055. Turns out this broke existing setups. --- diff --git a/nvmet/nvme.py b/nvmet/nvme.py index 89bf9cd..8253ea9 100644 --- a/nvmet/nvme.py +++ b/nvmet/nvme.py @@ -619,19 +619,6 @@ class Port(CFSNode): portid = property(_get_portid, doc="Get the Port ID as an int.") - def _get_state(self): - self._check_self() - _state = None - path = "%s/trstate" % self.path - if not os.path.isfile(path): - return None - - with open(path, 'r') as file_fd: - _state = file_fd.read().strip() - return _state - - state = property(_get_state, doc="Get the Port state.") - def _list_subsystems(self): return [os.path.basename(name) for name in os.listdir("%s/subsystems/" % self._path)] diff --git a/nvmetcli b/nvmetcli index 5d5aabc..6b102a2 100755 --- a/nvmetcli +++ b/nvmetcli @@ -388,14 +388,7 @@ class UIPortNode(UINode): if trsvcid != "none": info.append("trsvcid=%s" % trsvcid) enabled = not (not self.cfnode.subsystems and not list(self.cfnode.referrals)) - info.append("status=" + ("enabled" if enabled else "disabled")) - if not enabled: - ret = 0 - else: - trstate = self.cfnode.state - info.append("state=" + trstate) - ret = True if trstate == "up" else False - return (", ".join(info), ret) + return (", ".join(info), True if enabled else 0) class UIPortSubsystemsNode(UINode): def __init__(self, parent):