Merge PR #33042 into master

* refs/pull/33042/head:
	cephadm: bootstrap: warn on fqdn hostname

Reviewed-by: Sebastian Wagner <swagner@suse.com>
This commit is contained in:
Sage Weil 2020-02-07 08:47:52 -06:00
commit 06c9e64bc6

View File

@ -1610,6 +1610,8 @@ def command_bootstrap():
# initial vars
fsid = args.fsid or make_fsid()
hostname = get_hostname()
if '.' in hostname and not args.allow_fqdn_hostname:
raise Error('hostname is a fully qualified domain name (%s); either fix (e.g., "sudo hostname %s" or similar) or pass --allow-fqdn-hostname' % (hostname, hostname.split('.')[0]))
mon_id = args.mon_id or hostname
mgr_id = args.mgr_id or generate_service_id()
logging.info('Cluster fsid: %s' % fsid)
@ -2830,6 +2832,10 @@ def _get_parser():
'--allow-overwrite',
action='store_true',
help='allow overwrite of existing --output-* config/keyring/ssh files')
parser_bootstrap.add_argument(
'--allow-fqdn-hostname',
action='store_true',
help='allow hostname that is fully-qualified (contains ".")')
parser_deploy = subparsers.add_parser(
'deploy', help='deploy a daemon')