Created
May 25, 2011 11:32
-
-
Save chmouel/990809 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
US_RCLOUD_USER = os.environ.get("US_RCLOUD_USER") | |
US_RCLOUD_KEY = os.environ.get("US_RCLOUD_KEY") | |
US_RCLOUD_AURL = os.environ.get("US_RCLOUD_AURL") | |
UK_RCLOUD_USER = os.environ.get("UK_RCLOUD_USER") | |
UK_RCLOUD_KEY = os.environ.get("UK_RCLOUD_KEY") | |
UK_RCLOUD_AURL = os.environ.get("UK_RCLOUD_AURL") | |
def cf_us_auth(): | |
import cloudfiles | |
return cloudfiles.Connection(US_RCLOUD_USER, | |
US_RCLOUD_KEY) | |
def cf_uk_auth(): | |
import cloudfiles | |
return cloudfiles.Connection(UK_RCLOUD_USER, | |
UK_RCLOUD_KEY, | |
authurl=UK_RCLOUD_AURL) | |
def cs_uk_auth(): | |
import novaclient | |
return novaclient.OpenStack(UK_RCLOUD_USER, | |
UK_RCLOUD_KEY, | |
UK_RCLOUD_AURL) | |
def cs_us_auth(): | |
import cloudservers | |
return cloudservers.CloudServers(US_RCLOUD_USER, | |
US_RCLOUD_KEY, | |
US_RCLOUD_AURL) | |
def cb_us_auth(): | |
import cloudlb | |
return cloudlb.CloudLoadBalancer(US_RCLOUD_USER, | |
US_RCLOUD_KEY, | |
"chicago") | |
def dns_us_auth(): | |
from clouddns.connection import Connection | |
return Connection(US_RCLOUD_USER, US_RCLOUD_KEY) | |
print """# CloudFiles US | |
cs = cf_us_auth() | |
# CloudFiles UK | |
cs = cf_uk_auth() | |
# CloudServers UK | |
cs = cs_uk_auth() | |
# CloudServers US | |
cs = cs_us_auth() | |
# CloudLB ORD | |
cs = cb_us_auth() | |
# CloudDNS | |
cs = dns_us_auth()""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment