Skip to content

Commit

Permalink
Fixed bug 902058 (review comments fixed)
Browse files Browse the repository at this point in the history
Change-Id: If3f0a38dd704dfb3bacb4f29ddc9782c6897b1e9
  • Loading branch information
kavan-patil committed Dec 12, 2011
1 parent acb6967 commit 4ea2efb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
12 changes: 11 additions & 1 deletion tempest/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ConfigParser
import logging
import os
from tempest.common.utils import data_utils

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -38,6 +39,15 @@ def path(self):
"""Path of API request"""
return self.get("path", "/")

@property
def auth_url(self):
"""The Auth URL (derived)"""
auth_url = data_utils.build_url(self.host,
self.port,
self.apiVer,
self.path)
return auth_url

def params(self):
"""Parameters to be passed with the API request"""
return self.get("params", "")
Expand Down Expand Up @@ -111,7 +121,7 @@ def resize_available(self):

@property
def create_image_enabled(self):
""" Does the test environment support resizing """
""" Does the test environment support snapshots """
return self.get("create_image_enabled", 'false') != 'false'

@property
Expand Down
22 changes: 8 additions & 14 deletions tempest/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,50 +28,44 @@ def __init__(self):
config_file = os.environ.get('TEMPEST_CONFIG',
self.DEFAULT_CONFIG_FILE)
self.config = tempest.config.TempestConfig(config_dir, config_file)
self.auth_url = data_utils.build_url(self.config.nova.host,
self.config.nova.port,
self.config.nova.apiVer,
self.config.nova.path)

if self.config.env.authentication == 'keystone_v2':
self.servers_client = ServersClient(self.config,
self.config.nova.username,
self.config.nova.api_key,
self.auth_url,
self.config.nova.auth_url,
self.config.nova.tenant_name)
self.flavors_client = FlavorsClient(self.config,
self.config.nova.username,
self.config.nova.api_key,
self.auth_url,
self.config.nova.auth_url,
self.config.nova.tenant_name)
self.images_client = ImagesClient(self.config,
self.config.nova.username,
self.config.nova.api_key,
self.auth_url,
self.config.nova.auth_url,
self.config.nova.tenant_name)
self.limits_client = LimitsClient(self.config,
self.config.nova.username,
self.config.nova.api_key,
self.auth_url,
self.config.nova.auth_url,
self.config.nova.tenant_name)

else:
#Assuming basic/native authentication
self.servers_client = ServersClient(self.config,
self.config.nova.username,
self.config.nova.api_key,
self.auth_url)
self.config.nova.auth_url)
self.flavors_client = FlavorsClient(self.config,
self.config.nova.username,
self.config.nova.api_key,
self.auth_url)
self.config.nova.auth_url)
self.images_client = ImagesClient(self.config,
self.config.nova.username,
self.config.nova.auth_url,
self.config.nova.api_key,
self.auth_url)
self.config.nova.auth_url)
self.limits_client = LimitsClient(self.config,
self.config.nova.username,
self.config.nova.auth_url,
self.config.nova.api_key,
self.auth_url)
self.config.nova.auth_url)

0 comments on commit 4ea2efb

Please sign in to comment.