From 107711b04cfae7e55880268d41ca1782f29e0eca Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 27 Feb 2008 13:05:03 +0000
Subject: [PATCH] Use constants.ETC_HOSTS instead of string for /etc/hosts

Reviewed-by: iustinp
---
 lib/cmdlib.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 65c52a284..1a2706633 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -510,8 +510,8 @@ class LUInitCluster(LogicalUnit):
 
     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,))
+                                 " range (%s). Please fix DNS or %s." %
+                                 (hostname.ip, constants.ETC_HOSTS))
 
     self.clustername = clustername = utils.HostInfo(self.op.cluster_name)
 
@@ -1608,7 +1608,7 @@ class LUAddNode(LogicalUnit):
       dist_nodes.remove(myself.name)
 
     logger.Debug("Copying hosts and known_hosts to all nodes")
-    for fname in ("/etc/hosts", constants.SSH_KNOWN_HOSTS_FILE):
+    for fname in (constants.ETC_HOSTS, constants.SSH_KNOWN_HOSTS_FILE):
       result = rpc.call_upload_file(dist_nodes, fname)
       for to_node in dist_nodes:
         if not result[to_node]:
-- 
GitLab