-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> I, unfortunately, failed to understand your code until I had rediscovered
> and reimplemented the fix almost verbatim.
>
> So it was just a difference in style between your code and mine that I used
> [] when you used delete(), but
> I don't think it makes any difference whether we delete "type" and "title" -
> I'm pretty sure that there's plenty of other places that they get duplicated
> into the :parameters hash.
> I don't mind changing my commit if you disagree, though.
Well, it doesn't make any difference to fix the broken creation of
exported resources. However, it kinda makes the whole part:
# We do namespaces first, and use tmp variables, so our title
# canonicalization works (i.e., namespaces are set and resource
# types can be looked up)
tmp_type, tmp_title = extract_type_and_title(type, title)
self.type = tmp_type
self.title = tmp_title
useless, as type and title have already been assigned in the attributes
loop. Haven't they? I think they have, as they are not removed from
`hash` in Puppet::Rails::Resource#to_resource which then becomes
`attributes` in Puppet::Resource#initialize.
The only thing that happens here is then that we properly extract type
and title in extract_type_and_title, where it have been (possibly)
falsely assigned before (due to the implicitely assignement in the
`attributes` loop).
So in my opinion this is a bit ugly, but it doesn't affect anything, as
long as we're keeping Puppet::Resource#title= and Puppet::Resource#type=
the simple as they are now. But if they will get more logic, we might
then already fail in the attributes loop or trigger something twice and
first with a wrong parameter.
Oh, and what I also realized and also mentioned in my last bug notice is
that this fix _only_ fixes the improper creation of exported resources.
This means that the hash isn't anymore inspected, as it's not falsely
assigned. However, it doesn't fix the actual cause for the very big
result (and leaking) of the inspection of the hash coming from
Puppet::Rails::Resource#to_resource . So the problem won't appear
anymore at that stage, but might somewhere else. I'm not sure if you'd
like to deal with that separately or not.
cheers pete
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkw/y0QACgkQbwltcAfKi39u2ACfeliOTIJ/gt1/flYsu+LmDqMh
c/AAn32WI4OeAGCXIwjhf0hyQAltDwWu
=eNan
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.