Permalink
Browse files

Add support for different auth_server

ie: nova compute or rackspace cloud uk.
  • Loading branch information...
1 parent 4217bf9 commit cde5e55793c89b6d495f34f427073f40f510a2eb @chmouel committed Sep 7, 2011
Showing with 5 additions and 2 deletions.
  1. +2 −1 kick-example.conf
  2. +3 −1 kick.py
View
@@ -1,4 +1,5 @@
{
"username": "testuser",
-"key": "238a0938e920384afwhatever"
+"key": "238a0938e920384afwhatever",
+"auth_url": "https://auth.api.rackspacecloud.com/v1.0"
}
View
@@ -12,6 +12,7 @@
parser.add_option("-k", "--key", dest="key", default = None)
parser.add_option("-n", "--number", dest="number", type="int", default=1)
parser.add_option("-o", "--offset", dest="offset", type="int", default=1)
+parser.add_option("-a", "--auth-url", dest="auth_url", default="https://auth.api.rackspacecloud.com/v1.0")
(options,args) = parser.parse_args()
config_hash = {}
@@ -25,9 +26,10 @@
config_hash['username'] = options.username
config_hash['key'] = options.key
+ config_hash['auth_url'] = options.auth_url
try:
- cs = cloudservers.CloudServers(config_hash['username'], config_hash['key'])
+ cs = cloudservers.CloudServers(config_hash['username'], config_hash['key'], auth_url=options.auth_url)
cs.authenticate()
except Exception:
# doesn't throw cloudservers.Unauthorized. Sometimes it just

0 comments on commit cde5e55

Please sign in to comment.