[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pulp-list] Api.update()



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/09/2011 11:52 AM, Jeff Ortel wrote:
> 
> 
> On 03/09/2011 10:42 AM, Jay Dobies wrote:
> On 03/09/2011 11:18 AM, Jeff Ortel wrote:
>>>> After working through the "Update Semantics" story is seemed to me the
>>>> proposed update signature:
>>>>
>>>> Api.update(delta={})
>>>>
>>>> was kind of odd.  It was originally proposed this way to be more
>>>> comparable with how the update() was being used whereby a model object
>>>> was begin passed.  Now that semantics have been changed and a dictionary
>>>> (delta) of changed fields and/or keywords is passed, it seems to make
>>>> more sense to pass the object ID separate and *not* in the delta.
>>>>
>>>> So, unless there are objections, I'm changing the signature to be:
>>>>
>>>> Api.update(id, delta={})
>>>>
>>>> However, I am bullet proofing the impls to ignore the 'id' within the
>>>> 'delta'.
> 
> +1
> 
> I took a similar approach with the changes to the repo update messages
> sent to consumers. I wanted the ability to send an updated host list
> without resending the repo object itself so that the consumer has a
> better idea of what it was that changed. So instead of my first approach:
> 
> update(repo, host_urls, gpg_keys)
> 
> I went with:
> 
> update(repo_id, repo, host_urls, gpg_keys)
> 
> I prefer that approach, it just feels cleaner IMO.
> 
> One thing about that signature though, it'd be a legal call to just say
> Api.update('repo1') without passing in any deltas, which doesn't make
> much sense. It's not really a concern (the caller should know better
> than to do that), just curious if there's a reason for it.
> 
>> Oh, my bad.  I described the signature as delta={} for illustration.  It
>> will be implemented as:  update(id, delta)

Like 2 seconds after I hit send I wondered if that was the case. Thanks
for the clarification.

> 
>>
_______________________________________________
Pulp-list mailing list
Pulp-list redhat com
https://www.redhat.com/mailman/listinfo/pulp-list

> _______________________________________________
> Pulp-list mailing list
> Pulp-list redhat com
> https://www.redhat.com/mailman/listinfo/pulp-list


- -- 
Jay Dobies
RHCE# 805008743336126
Freenode: jdob
http://pulpproject.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNd7QqAAoJEOMmcTqOSQHCzS8H/jce4DVacLTRgqhmFVhlx3+K
8mzLW1KtJ1dXlevd462CeBRteSeSs22EgSCpavjFoNb2I2gT894yIomipqCrbFRj
mtUGlMAg/E+/bgTBEwEJAFglBg6EQsCxK8x4cC2Zn/dZzkS6RgrqVryf970RRhd3
KBbeMGdrmHPnYB64njZlXg51+LLG3nnuDswUxD7xjEMjHK4M3IuPBE1pJ1iC6cQc
Sb1Y3QXP8qYgm0WZnbDfvooTFEiQDFy7tehsG9y7IUUisRmWVxifvk5z0rToYT41
1FswySu1rBh3GmiCqzkxvvy3i6wffUmC7rBy4PLLro3uG051o1FC8WxFoJ7+gCg=
=JtcK
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]