Commit 130e907e authored by Iustin Pop's avatar Iustin Pop
Browse files

Add one more check on cluster init.

This adds a check that the initial node's IP name doesn't resolve to a
loopback address (127.x.y.z).

Also remove an unused variable.

Reviewed-by: imsnah
parent 727830bf
......@@ -546,6 +546,11 @@ class LUInitCluster(LogicalUnit):
" for hostname." %
(hostname_local, hostname["hostname_full"]))
if hostname["ip"].startswith("127."):
raise errors.OpPrereqError("This host's IP resolves to the private"
" range (%s). Please fix DNS or /etc/hosts." %
(hostname["ip"],))
self.clustername = clustername = utils.LookupHostname(self.op.cluster_name)
if not clustername:
raise errors.OpPrereqError("Cannot resolve given cluster name ('%s')"
......@@ -3085,7 +3090,6 @@ class LUReplaceDisks(LogicalUnit):
# start of work
remote_node = self.op.remote_node
cfg = self.cfg
vgname = cfg.GetVGName()
for dev in instance.disks:
size = dev.size
lv_names = [".%s_%s" % (dev.iv_name, suf) for suf in ["data", "meta"]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment