Thu, Jul 25, 2019 at 10:18:09AM CEST, olichtne(a)redhat.com wrote:
> > >> I have one more comment. I asked Ondrej why
following pattern is in
> > >> SimpleNetworkRecipe:
> > >>
> > >> + @property
> > >> + def offload_nics(self):
> > >> + return [self.matched.host1.bond0,
self.matched.host2.bond0]
> > >> +
> > >> + @property
> > >> + def mtu_hw_config_dev_list(self):
> > >> + return self.offload_nics
> > >> +
> > >>
> > >> I meant why we use offload_nics for mtu_hwconfig_dev_list. Ondrej said
> > >> that the idea is to avoid copy-paste errors. I'm fine with that.
> > >>
> > >> But when I checked the rest of the code, there's a mixture of
approach
> > >> there.
> > >>
> > >> E.g. following recipes does not follow this pattern:
> > >> lnst/Recipes/ENRT/IpsecEspAeadRecipe.py
> > >> lnst/Recipes/ENRT/IpsecEspAhCompRecipe.py
> > >> lnst/Recipes/ENRT/NoVirtOvsVxlanRecipe.py
> > >> lnst/Recipes/ENRT/SimpleMacsecRecipe.py
> > >>
> > >> I'd like to have this consistent.
> > >Ok, I will avoid referencing one property via another to avoid confusion
and
> > >misleads.
> >
> > Actually Ondrej wanted the other approach. It is okay to reference
> > one property via another.
Ok so I think for now it's safer for each property to create it's own
list explicitly. Reason being that I think we might want to re-evaluate
which nics get configured and also how the whole HwConfigMixin class
works.
So I think I prefer this:
@property
def offload_nics(self):
return [self.matched.host1.bond0, self.matched.host2.bond0]
@property
def mtu_hw_config_dev_list(self):
return [self.matched.host1.bond0, self.matched.host2.bond0]
-Ondrej
I agree. Thanks for thinking about that.
J.