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

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

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

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

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


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