* Guido Trotter <[email protected]> [2013-03-12 09:28:28 +0100]:

> > +
> >    def BuildHooksEnv(self):
> >      """Build hooks env.
> >
> >      """
> > -    args = {
> > -      "name": self.op.network_name,
> > -      "subnet": self.network.network,
> > -      "gateway": self.gateway,
> > -      "network6": self.network6,
> > -      "gateway6": self.gateway6,
> > -      "mac_prefix": self.mac_prefix,
> > -      "tags": self.tags,
> > -      }
> > -    return _BuildNetworkHookEnv(**args) # pylint: disable=W0142
> > +    return self.nobj.HooksDict()
> >
> 
> Are we actually sure about hooks here: should they not be passed the
> old object with the delta? See how this is done in InstanceSetParams.
> Here we seem to be passing just the changed values, without the ones
> which stay the same.
> 

I see. One question: hooks env are evaluated once after CheckPrereq()
for the pre phase and once after Exec for the post phase. Correct?
If yes, based on that I thought we could pass the old object in the
pre phase and the new one in the post phase. If that is not acceptable
I propose to build a dummy network object with modified values and
use HooksDict() (and still remove that duplicate code of
BuildNetworkHooksEnv()). Any comments?

Thanks a lot,
dimara

Attachment: signature.asc
Description: Digital signature

Reply via email to