Revision ee045466

b/lib/backend.py
200 200
  """
201 201
  allowed_files = set([
202 202
    pathutils.CLUSTER_CONF_FILE,
203
    constants.ETC_HOSTS,
203
    pathutils.ETC_HOSTS,
204 204
    pathutils.SSH_KNOWN_HOSTS_FILE,
205 205
    pathutils.VNC_PASSWORD_FILE,
206 206
    pathutils.RAPI_CERT_FILE,
b/lib/bootstrap.py
329 329
  if ipcls.IsLoopback(hostname.ip):
330 330
    raise errors.OpPrereqError("This host's IP (%s) resolves to a loopback"
331 331
                               " address. Please fix DNS or %s." %
332
                               (hostname.ip, constants.ETC_HOSTS),
332
                               (hostname.ip, pathutils.ETC_HOSTS),
333 333
                               errors.ECODE_ENVIRON)
334 334

  
335 335
  if not ipcls.Own(hostname.ip):
b/lib/cmdlib.py
4311 4311
    files_all.update(ssconf.SimpleStore().GetFileList())
4312 4312

  
4313 4313
  if cluster.modify_etc_hosts:
4314
    files_all.add(constants.ETC_HOSTS)
4314
    files_all.add(pathutils.ETC_HOSTS)
4315 4315

  
4316 4316
  if cluster.use_external_mip_script:
4317 4317
    files_all.add(pathutils.EXTERNAL_MASTER_SETUP_SCRIPT)
b/lib/constants.py
136 136
SECURE_DIR_MODE = 0700
137 137
SECURE_FILE_MODE = 0600
138 138
ADOPTABLE_BLOCKDEV_ROOT = "/dev/disk/"
139
ETC_HOSTS = "/etc/hosts"
140 139
ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE
141 140
ENABLE_SHARED_FILE_STORAGE = _autoconf.ENABLE_SHARED_FILE_STORAGE
142 141
ENABLE_CONFD = _autoconf.ENABLE_CONFD
b/lib/pathutils.py
45 45
KVM_IFUP = _autoconf.PKGLIBDIR + "/kvm-ifup"
46 46
SETUP_SSH = _autoconf.TOOLSDIR + "/setup-ssh"
47 47
XM_CONSOLE_WRAPPER = _autoconf.PKGLIBDIR + "/tools/xm-console-wrapper"
48
ETC_HOSTS = "/etc/hosts"
48 49

  
49 50
# Top-level paths
50 51
DATA_DIR = LOCALSTATEDIR + "/lib/ganeti"
b/lib/utils/nodesetup.py
24 24

  
25 25
from cStringIO import StringIO
26 26

  
27
from ganeti import constants
27
from ganeti import pathutils
28 28

  
29 29
from ganeti.utils import algo
30 30
from ganeti.utils import io
......
71 71

  
72 72
  @type hostname: str
73 73
  @param hostname: a hostname that will be resolved and added to
74
      L{constants.ETC_HOSTS}
74
      L{pathutils.ETC_HOSTS}
75 75
  @type ip: str
76 76
  @param ip: The ip address of the host
77 77

  
78 78
  """
79
  SetEtcHostsEntry(constants.ETC_HOSTS, ip, hostname, [hostname.split(".")[0]])
79
  SetEtcHostsEntry(pathutils.ETC_HOSTS, ip, hostname, [hostname.split(".")[0]])
80 80

  
81 81

  
82 82
def RemoveEtcHostsEntry(file_name, hostname):
......
115 115
  @type hostname: str
116 116
  @param hostname: hostname that will be resolved and its
117 117
      full and shot name will be removed from
118
      L{constants.ETC_HOSTS}
118
      L{pathutils.ETC_HOSTS}
119 119

  
120 120
  """
121
  RemoveEtcHostsEntry(constants.ETC_HOSTS, hostname)
122
  RemoveEtcHostsEntry(constants.ETC_HOSTS, hostname.split(".")[0])
121
  RemoveEtcHostsEntry(pathutils.ETC_HOSTS, hostname)
122
  RemoveEtcHostsEntry(pathutils.ETC_HOSTS, hostname.split(".")[0])

Also available in: Unified diff