cephadm: support quotes around public/cluster network in config passed to bootstrap

Fixes: https://tracker.ceph.com/issues/56973

Signed-off-by: Adam King <adking@redhat.com>
This commit is contained in:
Adam King 2022-07-29 17:26:58 -04:00
parent 8761314777
commit 9ec3d20319

View File

@ -4885,7 +4885,7 @@ def get_public_net_from_cfg(ctx: CephadmContext) -> Optional[str]:
return None
# Ensure all public CIDR networks are valid
public_network = cp.get('global', 'public_network')
public_network = cp.get('global', 'public_network').strip('"').strip("'")
rc, _, err_msg = check_subnet(public_network)
if rc:
raise Error(f'Invalid public_network {public_network} parameter: {err_msg}')
@ -4982,7 +4982,7 @@ def prepare_cluster_network(ctx: CephadmContext) -> Tuple[str, bool]:
cp = read_config(ctx.config)
cluster_network = ctx.cluster_network
if cluster_network is None and cp.has_option('global', 'cluster_network'):
cluster_network = cp.get('global', 'cluster_network')
cluster_network = cp.get('global', 'cluster_network').strip('"').strip("'")
if cluster_network:
cluser_nets = set([x.strip() for x in cluster_network.split(',')])