From 998bd8d513854a5b1ffc09364491db464c2f5759 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 10 Dec 2015 11:33:21 -0500 Subject: [PATCH] default host to service name instead of uuid The host associated with a service looks like it really should be a hostname and not a uuid in the current code. This changes it to default to the name of the service started if nothing else is specified in the test fixture. It then updates all samples to expect a thing that looks like a name, and not a uuid. This also allows us to drop the special casing of this function for aggregate testing. Change-Id: I37415b89b733c021daa38040fee447cf3934b821 --- nova/tests/fixtures.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nova/tests/fixtures.py b/nova/tests/fixtures.py index 4f4bb9f96..9b2d3276b 100644 --- a/nova/tests/fixtures.py +++ b/nova/tests/fixtures.py @@ -19,7 +19,6 @@ from __future__ import absolute_import import logging as std_logging import os -import uuid import warnings import fixtures @@ -47,7 +46,10 @@ class ServiceFixture(fixtures.Fixture): def __init__(self, name, host=None, **kwargs): name = name - host = host or uuid.uuid4().hex + # If not otherwise specified, the host will default to the + # name of the service. Some things like aggregates care that + # this is stable. + host = host or name kwargs.setdefault('host', host) kwargs.setdefault('binary', 'nova-%s' % name) self.kwargs = kwargs