Skip to content

Instantly share code, notes, and snippets.

@azizmb azizmb/
Last active Jan 4, 2016

What would you like to do?
Simple shell which initializes a connection to Rackspace CloudFiles
import argparse
import cloudfiles
from cloudfiles.connection import Connection
AUTH_URLS = ['uk_authurl', 'us_authurl']
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("rcloud_user", help="the rcloud user to use")
parser.add_argument("rcloud_key", help="the rcloud api key to use")
parser.add_argument("-s", "--servicenet", help="whether to use servicenet",
parser.add_argument("-a", "--authurl", help="which authurl to use",
choices=AUTH_URLS, default=AUTH_URLS[0])
args = parser.parse_args()
con = Connection(
authurl=getattr(cloudfiles, args.authurl),
print 'Connection object is available as con'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.