[Chicago] Video

Brian Curtin brian at python.org
Tue Nov 19 03:13:41 CET 2013


On Mon, Nov 18, 2013 at 6:39 PM, Carl Karsten <carl at personnelware.com> wrote:
> I got it working, but could use a code review of my uploader:
>
> https://github.com/CarlFK/veyepar/blob/master/dj/scripts/rax_uploader.py
>
> This line bothers me:
> pyrax.set_setting("identity_type", "rackspace")
>
> maybe that should be right under the import pyrax?

Yeah, any set_setting stuff typically goes right under the import pyrax.

> if you want to write a line of code ...
> I generally leave this code alone until I get an error, then I try to
> figure out what I need to debug it
> but if you can give me a head start, that may come in handy some day ;)
>
>     except Exception as e:
>
>             print e
>             # self.ret_text = "rax error: %s" % ( e.body )
>
>
> Does rackspace have something setup for testing so that someone can
> run this code with minimal server side setup?  currently it requires
> someone (Sheila) getting the  rackspace account setup and creating a
> user account for me, I log in and create a container for testing
> called testing, get my api keys, copy/paste them into the code, and
> now I can run it.    This is fine for production, but if I am handing
> it off to someone to test, they will get annoyed and the test will
> likely just show that they screwed up the server setup and that is why
> they gave up trying to help ;/

There's no server aspect to Cloud Files, as it's just blob storage, so
I guess I'd need the bigger picture to understand the full issue
you're having.

What kind of testing are you doing? If you're doing integration
testing with a live account, you're going to have to pass off creds to
anyone who's helping out - nothing can get around that. At the very
least, unit tests that mock out methods like get_container and
upload_file would probably be helpful.


More information about the Chicago mailing list