[PATCH 4/9] Add type-specific methods for member set management.
David Lehman
dlehman at redhat.com
Fri Mar 21 15:11:03 UTC 2014
On Fri, 2014-03-21 at 08:42 +0100, Vratislav Podzimek wrote:
> > + def memberStatus(self, member):
> > + if not (self.status and member.status):
> > + return
> > +
> > + member_name = os.path.basename(member.sysfsPath)
> > + path = "/sys/%s/md/dev-%s/state" % (self.sysfsPath, member_name)
> > + try:
> > + state = open(path).read().strip()
> > + except IOError:
> > + state = None
> > +
> > + return state
> I think this is a good candidate for another function in
> devicelibs/mdraid.py.
It is. So is the degraded property just below. Both use a sysfs path,
however, so moving them to devicelibs one would have to choose between
constructing the sysfs path in devicelibs based on array name or having
the identifying parameter be a sysfs path instead of array name or path.
I'm not crazy about either option.
David
More information about the anaconda-patches
mailing list