]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
Revert "nvmetcli: expose nvmet port status and state"
authorChristoph Hellwig <hch@lst.de>
Wed, 23 May 2018 07:31:58 +0000 (09:31 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 23 May 2018 07:31:58 +0000 (09:31 +0200)
This reverts commit 54ce6d02112f267733402735b1dbb3635dfa8055.

Turns out this broke existing setups.

nvmet/nvme.py
nvmetcli

index 89bf9cd956a89b661ac1cbe3682653f6e83a94a2..8253ea9264b77ff6c3764b100f4ab23bf9327d43 100644 (file)
@@ -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)]
index 5d5aabc89b1c25103d887d49aec65a4ab8089f27..6b102a235450c41ce4a31521d5bede0618781d99 100755 (executable)
--- 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):