Skip to content
Snippets Groups Projects
Commit 838b947c authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

nvmet: make attr_groups public for nvmetcli


Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 29eb9cc1
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ class CFSNode(object): ...@@ -50,7 +50,7 @@ class CFSNode(object):
def __init__(self): def __init__(self):
self._path = self.configfs_dir self._path = self.configfs_dir
self._attr_groups = [] self.attr_groups = []
def __eq__(self, other): def __eq__(self, other):
return self._path == other._path return self._path == other._path
...@@ -177,7 +177,7 @@ class CFSNode(object): ...@@ -177,7 +177,7 @@ class CFSNode(object):
def dump(self): def dump(self):
d = {} d = {}
for group in self._attr_groups: for group in self.attr_groups:
a = {} a = {}
for i in self.list_attrs(group, writable=True): for i in self.list_attrs(group, writable=True):
a[str(i)] = self.get_attr(group, i) a[str(i)] = self.get_attr(group, i)
...@@ -185,7 +185,7 @@ class CFSNode(object): ...@@ -185,7 +185,7 @@ class CFSNode(object):
return d return d
def _setup_attrs(self, attr_dict, err_func): def _setup_attrs(self, attr_dict, err_func):
for group in self._attr_groups: for group in self.attr_groups:
for name, value in attr_dict.get(group, {}).iteritems(): for name, value in attr_dict.get(group, {}).iteritems():
try: try:
self.set_attr(group, name, value) self.set_attr(group, name, value)
...@@ -434,7 +434,7 @@ class Namespace(CFSNode): ...@@ -434,7 +434,7 @@ class Namespace(CFSNode):
if nsid < 1 or nsid > self.MAX_NSID: if nsid < 1 or nsid > self.MAX_NSID:
raise CFSError("NSID must be 1 to %d" % self.MAX_NSID) raise CFSError("NSID must be 1 to %d" % self.MAX_NSID)
self._attr_groups = ['device'] self.attr_groups = ['device']
self._subsystem = subsystem self._subsystem = subsystem
self._nsid = nsid self._nsid = nsid
self._path = "%s/namespaces/%d" % (self.subsystem.path, self.nsid) self._path = "%s/namespaces/%d" % (self.subsystem.path, self.nsid)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment