]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
nvmet: small fixes and cleanups
authorChristoph Hellwig <hch@lst.de>
Wed, 25 May 2016 12:30:50 +0000 (14:30 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 25 May 2016 12:50:30 +0000 (14:50 +0200)
Signed-off-by: Christoph Hellwig <hch@lst.de>
nvmet/nvme.py

index e3b85a763ef963bcaf3f3bf4285883045207644f..b5e6e4f661d5be20e1fd052e7c2be80699844b4e 100644 (file)
@@ -422,11 +422,6 @@ class Subsystem(CFSNode):
         name = str(uuid.uuid4())
         return "%s:%s" % (prefix, name)
 
-    def _list_namespaces(self):
-        self._check_self()
-        for d in os.listdir("%s/namespaces/" % self._path):
-            yield Namespace(self, int(d), 'lookup')
-
     def delete(self):
         '''
         Recursively deletes a Subsystem object.
@@ -440,6 +435,11 @@ class Subsystem(CFSNode):
             self.remove_allowed_host(h)
         super(Subsystem, self).delete()
 
+    def _list_namespaces(self):
+        self._check_self()
+        for d in os.listdir("%s/namespaces/" % self._path):
+            yield Namespace(self, int(d), 'lookup')
+
     namespaces = property(_list_namespaces,
                           doc="Get the list of Namespaces for the Subsystem.")
 
@@ -592,8 +592,7 @@ class Namespace(CFSNode):
 
 class Port(CFSNode):
     '''
-    This is an interface to a NVMe Namespace in configFS.
-    A Namespace is identified by its parent Subsystem and Namespace ID.
+    This is an interface to a NVMe Port in configFS.
     '''
 
     MAX_PORTID = 8192
@@ -625,8 +624,7 @@ class Port(CFSNode):
     def _get_portid(self):
         return self._portid
 
-    portid = property(_get_portid,
-            doc="Get the Port ID as an int.")
+    portid = property(_get_portid, doc="Get the Port ID as an int.")
 
     def _list_subsystems(self):
         return [os.path.basename(name)
@@ -660,7 +658,7 @@ class Port(CFSNode):
         '''
         self._check_self()
         for s in self.subsystems:
-            self.remove_subsystem(s);
+            self.remove_subsystem(s)
         super(Port, self).delete()
 
     @classmethod