Skip to content

Commit

Permalink
Merge branch 'working'
Browse files Browse the repository at this point in the history
  • Loading branch information
sivel committed Jan 19, 2016
2 parents 2bc45b3 + e7d729f commit 15f1ac7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
19 changes: 10 additions & 9 deletions pyrax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
import six.moves.configparser as ConfigParser
import warnings

# Ignore UserWarnings. Currently we're getting warnings about novaclient.v1_1
# deprecations as UserWarning instead of DeprecationWarning (why?).
warnings.filterwarnings("ignore", ".*novaclient.v1_1 is deprecated.*")

# keyring is an optional import
try:
import keyring
Expand All @@ -61,8 +57,9 @@
from novaclient import exceptions as _cs_exceptions
from novaclient import auth_plugin as _cs_auth_plugin
from novaclient import client as nc
from novaclient.v1_1 import client as _cs_client
from novaclient.v1_1.servers import Server as CloudServer
from novaclient import client as _cs_client
from novaclient import API_MAX_VERSION as _cs_max_version
from novaclient.v2.servers import Server as CloudServer

from .autoscale import AutoScaleClient
from .cloudcdn import CloudCDNClient
Expand Down Expand Up @@ -120,7 +117,7 @@
services = tuple()

_client_classes = {
"compute": _cs_client.Client,
"compute": _cs_client.get_client_class(_cs_max_version),
"cdn": CloudCDNClient,
"object_store": StorageClient,
"database": CloudDatabaseClient,
Expand Down Expand Up @@ -679,8 +676,12 @@ def connect_to_cloudservers(region=None, context=None, verify_ssl=None, **kwargs
insecure = not get_setting("verify_ssl")
else:
insecure = not verify_ssl
extensions = nc.discover_extensions("1.1")
cloudservers = _cs_client.Client(context.username, context.password,
try:
extensions = nc.discover_extensions(_cs_max_version)
except AttributeError:
extensions = None
clt_class = _cs_client.get_client_class(_cs_max_version)
cloudservers = clt_class(context.username, context.password,
project_id=context.tenant_id, auth_url=context.auth_endpoint,
auth_system=id_type, region_name=region, service_type="compute",
auth_plugin=auth_plugin, insecure=insecure, extensions=extensions,
Expand Down
4 changes: 4 additions & 0 deletions pyrax/base_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,10 @@ def _parse_service_catalog(self):
if not hasattr(service, "endpoints"):
# Not an OpenStack service
continue
if service.prefix == '' and service.service_type == 'dns':
# Skip service registration of Managed DNS
# so it doesn't conflict with Cloud DNS
continue
setattr(self.services, service.service_type, service)
self.regions.update(list(service.endpoints.keys()))
# Update the 'ALL' services to include all available regions.
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def run(self):
"Operating System :: OS Independent",
],
install_requires=[
"python-novaclient>=2.13.0,<=2.27.0",
"python-novaclient==2.27.0",
"rackspace-novaclient",
"keyring",
"requests>=2.2.1",
"six>=1.9.0",
"requests>=2.2.1,<3",
"six>=1.9.0,<2",
] + testing_requires,
packages=[
"pyrax",
Expand Down

0 comments on commit 15f1ac7

Please sign in to comment.