From 90236c263c59f5c068492713bf9f27f74905bf73 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 25 Nov 2015 13:47:30 -0600 Subject: [PATCH] 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 --- rally-jobs/plugins/clusters.py | 7 +++++-- rally-jobs/plugins/cue_utils.py | 7 ++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rally-jobs/plugins/clusters.py b/rally-jobs/plugins/clusters.py index 5308605d..70525134 100644 --- a/rally-jobs/plugins/clusters.py +++ b/rally-jobs/plugins/clusters.py @@ -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" diff --git a/rally-jobs/plugins/cue_utils.py b/rally-jobs/plugins/cue_utils.py index 9df84944..4834843b 100644 --- a/rally-jobs/plugins/cue_utils.py +++ b/rally-jobs/plugins/cue_utils.py @@ -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,