From: Christoph Hellwig <hch@lst.de>
Date: Sun, 3 Apr 2016 15:45:02 +0000 (+0200)
Subject: nvmet: fix attribute listing
X-Git-Tag: v0.2~17
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cbb9b324baeaf5ebda44dd1b39b92791b866eecf;p=users%2Fhch%2Fnvmetcli.git

nvmet: fix attribute listing

We only want to split at the first underscore, not at any.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---

diff --git a/nvmet/nvme.py b/nvmet/nvme.py
index 0d6cdbd..c25d237 100644
--- a/nvmet/nvme.py
+++ b/nvmet/nvme.py
@@ -106,7 +106,7 @@ class CFSNode(object):
         '''
         self._check_self()
 
-        names = [os.path.basename(name).split('_')[1]
+        names = [os.path.basename(name).split('_', 1)[1]
                  for name in glob("%s/%s_*" % (self._path, group))
                      if os.path.isfile(name)]