Fix random name generation in Rally plugins

rally.common.utils.generate_random_name() is being removed and
replaced with a mixin that has slightly different semantics.

Change-Id: If7a0dc2e155672ad48472d6e4202a82e205a0c33
Implements: blueprint consistent-random-names
This commit is contained in:
Chris St. Pierre 2015-11-25 13:47:30 -06:00 committed by Min Pae
parent 3bb4942e84
commit 90236c263c
2 changed files with 7 additions and 7 deletions

View File

@ -15,8 +15,8 @@
import cue_utils
from oslo_log import log as logging
from rally.common import log as rally_logging
from rally.common import sshutils
from rally.common import utils as common_utils
from rally.plugins.openstack import scenario
from rally.task import types as types
@ -81,6 +81,9 @@ class CueClusters(cue_utils.CueScenario):
@types.set(image=types.ImageResourceType,
flavor=types.FlavorResourceType)
@rally_logging.log_deprecated_args(
"server_name will always be randomly generated", "0.1.3",
["server_name"])
@scenario.configure()
def create_verify_and_delete_cluster(self, image, flavor, network_id=None,
server_name="rally_vm",
@ -105,7 +108,7 @@ class CueClusters(cue_utils.CueScenario):
:param cluster_check_interval: int, check interval seconds
:param kwargs: other optional parameters to initialize the server
"""
server_name = common_utils.generate_random_name(server_name + '_')
server_name = self.generate_random_name()
nova_server_boot_timeout = 60 * 5
network_name = "rally_network"
sec_group_name = "rally_sec_group"

View File

@ -18,7 +18,6 @@ import time
import keystoneclient.openstack.common.apiclient.exceptions as ks_exceptions
from rally.common import log as logging
from rally.common import utils as common_utils
from rally.plugins.openstack import scenario
from rally.task import atomic
from rally.task import utils as task_utils
@ -53,8 +52,7 @@ class CueScenario(scenario.OpenStackScenario):
:param volume_size: int, volume size for VM instance(s)
:returns: new cue cluster details
"""
cluster_name = name or common_utils.generate_random_name(
'rally_cue_cluster_')
cluster_name = name or self.generate_random_name()
cue_client = cueclient or self.clients("cue")
return cue_client.clusters.create(name=cluster_name, nic=network_id,
flavor=flavor, size=size,
@ -223,8 +221,7 @@ class CueScenario(scenario.OpenStackScenario):
:param cluster_check_interval: int, interval to check status change
:return: new cue cluster
"""
cluster_name = cluster_name or common_utils.generate_random_name(
'rally_cue_cluster_')
cluster_name = cluster_name or self.generate_random_name()
cluster_dict = {'name': cluster_name,
'flavor': cluster_flavor,
'size': size,