[PATCH 3/9] Adapt callers to new method names for add/remove member device.

David Lehman dlehman at redhat.com
Fri Mar 21 15:08:01 UTC 2014


On Fri, 2014-03-21 at 08:38 +0100, Vratislav Podzimek wrote:
> On Thu, 2014-03-20 at 12:14 -0500, David Lehman wrote:
> > ---
> >  blivet/devicefactory.py | 26 +++++++++++++-------------
> >  blivet/devicetree.py    | 10 +++++-----
> >  2 files changed, 18 insertions(+), 18 deletions(-)
> > 
> > diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
> > index d1e4779..9d752bf 100644
> > --- a/blivet/devicefactory.py
> > +++ b/blivet/devicefactory.py
> > @@ -482,11 +482,11 @@ class DeviceFactory(object):
> >          log.debug("old member set: %s" % [d.name for d in self.container.parents])
> >          for member in self.container.parents[:]:
> >              if member not in members:
> > -                self.container.removeMember(member)
> > +                self.container._removeMember(member)
> Why are those methods all private even if we want to call them directly?
> As I see it no public wrappers are needed and they can simply be made
> public.

Mainly it is there to distinguish between add (actually remove the
member) and _addMember (modify the in-memory model). I was concerned
that making _addMember public would cause confusion. Also, nothing
outside of blivet should be calling that method directly -- it should be
done only by instantiating the action classes.

David



More information about the anaconda-patches mailing list