From d26f5e70e74181ea9bc3aaad7322e306e5d5d867 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 20 Feb 2018 12:28:24 -0500 Subject: [PATCH] qa/rgw: rgw task can override --rgw-dns-name on the command line the value for rgw_dns_name isn't known until a machine is assigned, so it can't be set via 'override: conf:'. add a per-client config option to the rgw task so it can add the endpoint's hostname and/or s3website hostname on the radosgw command line Signed-off-by: Casey Bodley (cherry picked from commit 658e5932fb79e2d33b73363b6ce76ff299809e16) --- qa/tasks/rgw.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/qa/tasks/rgw.py b/qa/tasks/rgw.py index 545a0f8238170..c48a4677ca7ce 100644 --- a/qa/tasks/rgw.py +++ b/qa/tasks/rgw.py @@ -22,10 +22,12 @@ from util.rados import (rados, create_ec_pool, log = logging.getLogger(__name__) class RGWEndpoint: - def __init__(self, hostname=None, port=None, cert=None): + def __init__(self, hostname=None, port=None, cert=None, dns_name=None, website_dns_name=None): self.hostname = hostname self.port = port self.cert = cert + self.dns_name = dns_name + self.website_dns_name = website_dns_name def url(self): proto = 'https' if self.cert else 'http' @@ -105,6 +107,11 @@ def start_rgw(ctx, config, clients): kport=keystone_port), ]) + if client_config.get('dns-name'): + rgw_cmd.extend(['--rgw-dns-name', endpoint.dns_name]) + if client_config.get('dns-s3website-name'): + rgw_cmd.extend(['--rgw-dns-s3website-name', endpoint.website_dns_name]) + rgw_cmd.extend([ '--foreground', run.Raw('|'), @@ -186,7 +193,17 @@ def assign_endpoints(ctx, config, default_cert): port = next_port next_port += 1 - role_endpoints[role] = RGWEndpoint(remote.hostname, port, ssl_certificate) + # if dns-name is given, use it as the hostname (or as a prefix) + dns_name = client_config.get('dns-name', '') + if len(dns_name) == 0 or dns_name.endswith('.'): + dns_name += remote.hostname + + website_dns_name = client_config.get('dns-s3website-name') + if website_dns_name: + if len(website_dns_name) == 0 or website_dns_name.endswith('.'): + website_dns_name += remote.hostname + + role_endpoints[role] = RGWEndpoint(remote.hostname, port, ssl_certificate, dns_name, website_dns_name) return role_endpoints -- 2.39.5