[Pulp-list] pulp client changes

Jason L Connor jconnor at redhat.com
Wed Feb 16 20:31:31 UTC 2011


Hi All,

I've just pushed some disruptive changes to the client.

In order to facilitate unittests on the client, I refactored
pulp.client.connection. I abstracted out the restlib stuff into a
"server" class representing the server that the client talks to and
moved all of this into a new pulp.client.server module.

We have retained the ability to specify a pulp server on the command
line. However we now use --host instead of --server, along with --port,
--scheme, and --path to match the entries from the server section of the
client.conf file.

I also broke out the rest of the 'connections' into a client-side api
package: pulp.client.api.<repository, consumer, etc>. This connections
module was 1000 lines long, which is just plain silly in python. The new
api classes seamlessly  use the new server classes.

The biggest changes here are that the request methods of the server
return both the http status and the body of the response instead of just
the body now. And on errors, it raises a ServerRequestError that takes
the status and the body as its arguments and can be accessed via the
fields: args[0] and args[1].

The server does *not* attempt to automatically handle any of these
errors. It has been left to the api authors to figure out what to do. If
the error is allowed to propigate, the action class will catch it, print
out the body (potentially a server-side traceback) and exit.

I'm happy to give a deep dive tomorrow to further go into the changes.
-- 
Jason L Connor
linear on freenode #pulp
http://pulpproject.org/
RHCE: 805010912355231
GPG Fingerprint: 2048R/CC4ED7C1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20110216/a267fefe/attachment.sig>


More information about the Pulp-list mailing list