Commit 991d0aeb authored by Simon Leinen's avatar Simon Leinen

No longer specify service_type="compute"

Apparently it's not necessary.

Also, import warnings and use warn() to issue warnings.
parent d0b34ed3
......@@ -29,7 +29,7 @@
import os
import re
import sys
import warnings
from warnings import warn
from keystoneclient.v2_0 import client as keystone_client
from keystoneclient.auth.identity import v2
from keystoneclient import session
......@@ -83,7 +83,6 @@ class UsageAnalyzer:
for region in self.get_regions():
ne[region] = nova_client.Client(session=self.auth_session,
......@@ -94,11 +93,12 @@ class UsageAnalyzer:
except BadRequest as c:
print "WARN:", c
warn("Error creating nova client using session:\n "
+ str(c)
+ "\nRetrying using traditional credentials")
ne[region] = nova_client.Client(
self.username, self.password,
self.tenant_name, self.auth_url,
self._nova_endpoints = ne
return ne
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment