Revision b8669a69

b/autotools/build-bash-completion
33 33
import optparse
34 34
from cStringIO import StringIO
35 35

  
36
# _constants shouldn't be imported from anywhere except constants.py, but we're
37
# making an exception here because this script is only used at build time.
38
from ganeti import _constants
39

  
36 40
from ganeti import constants
37 41
from ganeti import cli
38 42
from ganeti import utils
......
41 45

  
42 46
from ganeti.tools import burnin
43 47

  
44
# _autoconf shouldn't be imported from anywhere except constants.py, but we're
45
# making an exception here because this script is only used at build time.
46
from ganeti import _autoconf
47

  
48 48
#: Regular expression describing desired format of option names. Long names can
49 49
#: contain lowercase characters, numbers and dashes only.
50 50
_OPT_NAME_RE = re.compile(r"^-[a-zA-Z0-9]|--[a-z][-a-z0-9]+$")
......
832 832
  WritePreamble(sw, debug)
833 833

  
834 834
  # gnt-* scripts
835
  for scriptname in _autoconf.GNT_SCRIPTS:
835
  for scriptname in _constants.GNT_SCRIPTS:
836 836
    filename = "scripts/%s" % scriptname
837 837

  
838 838
    WriteCompletion(sw, scriptname, GetFunctionName(scriptname), debug,
......
849 849
                         debug=not options.compact)
850 850

  
851 851
  # htools, if enabled
852
  if _autoconf.HTOOLS:
853
    for script in _autoconf.HTOOLS_PROGS:
852
  if _constants.HTOOLS:
853
    for script in _constants.HTOOLS_PROGS:
854 854
      WriteHaskellCompletion(sw, script, htools=True, debug=debug)
855 855

  
856 856
  # ganeti-confd, if enabled
857
  if _autoconf.ENABLE_CONFD:
857
  if _constants.ENABLE_CONFD:
858 858
    WriteHaskellCompletion(sw, "src/ganeti-confd", htools=False,
859 859
                           debug=debug)
860 860

  
861 861
  # mon-collector, if monitoring is enabled
862
  if _autoconf.ENABLE_MOND:
862
  if _constants.ENABLE_MOND:
863 863
    WriteHaskellCmdCompletion(sw, "src/mon-collector", debug=debug)
864 864

  
865 865
  # Reset extglob to original value
b/autotools/convert-constants
25 25
import re
26 26
import types
27 27

  
28
from ganeti import _autoconf
29 28
from ganeti import _constants
30 29
from ganeti import compat
31 30
from ganeti import constants
......
306 305
  print Convert(constants, "")
307 306
  print Convert(luxi, "luxi")
308 307
  print Convert(qlang, "qlang")
309
  print Convert(_autoconf, "autoconf")
310 308
  print Convert(errors, "errors")
311 309
  print Convert(jstore, "jstore")
312 310

  
b/lib/build/sphinx_ext.py
46 46
  # Normally the "manpage" role is registered by sphinx/roles.py
47 47
  raise Exception("Can't find reST role named 'manpage': %s" % err)
48 48

  
49
from ganeti import _constants
49 50
from ganeti import constants
50 51
from ganeti import compat
51 52
from ganeti import errors
......
57 58
from ganeti import luxi
58 59
from ganeti import objects
59 60
from ganeti import http
60
from ganeti import _autoconf
61 61

  
62 62
import ganeti.rapi.rlib2 # pylint: disable=W0611
63 63
import ganeti.rapi.connector # pylint: disable=W0611
......
385 385
    name = m.group("name")
386 386
    section = int(m.group("section"))
387 387

  
388
    wanted_section = _autoconf.MAN_PAGES.get(name, None)
388
    wanted_section = _constants.MAN_PAGES.get(name, None)
389 389

  
390 390
    if not (wanted_section is None or wanted_section == section):
391 391
      raise ReSTError("Referenced man page '%s' has section number %s, but the"
b/lib/pathutils.py
23 23

  
24 24
"""
25 25

  
26
from ganeti import _autoconf
27 26
from ganeti import _constants
28 27
from ganeti import compat
29 28
from ganeti import vcluster
......
35 34
DEFAULT_SHARED_FILE_STORAGE_DIR = "/srv/ganeti/shared-file-storage"
36 35
DEFAULT_SHARED_FILE_STORAGE_DIR = \
37 36
    vcluster.AddNodePrefix(DEFAULT_SHARED_FILE_STORAGE_DIR)
38
EXPORT_DIR = vcluster.AddNodePrefix(_autoconf.EXPORT_DIR)
37
EXPORT_DIR = vcluster.AddNodePrefix(_constants.EXPORT_DIR)
39 38
OS_SEARCH_PATH = _constants.OS_SEARCH_PATH
40 39
ES_SEARCH_PATH = _constants.ES_SEARCH_PATH
41
SSH_CONFIG_DIR = _autoconf.SSH_CONFIG_DIR
42
XEN_CONFIG_DIR = vcluster.AddNodePrefix(_autoconf.XEN_CONFIG_DIR)
43
SYSCONFDIR = vcluster.AddNodePrefix(_autoconf.SYSCONFDIR)
44
TOOLSDIR = _autoconf.TOOLSDIR
45
LOCALSTATEDIR = vcluster.AddNodePrefix(_autoconf.LOCALSTATEDIR)
40
SSH_CONFIG_DIR = _constants.SSH_CONFIG_DIR
41
XEN_CONFIG_DIR = vcluster.AddNodePrefix(_constants.XEN_CONFIG_DIR)
42
SYSCONFDIR = vcluster.AddNodePrefix(_constants.SYSCONFDIR)
43
TOOLSDIR = _constants.TOOLSDIR
44
LOCALSTATEDIR = vcluster.AddNodePrefix(_constants.LOCALSTATEDIR)
46 45

  
47 46
# Paths which don't change for a virtual cluster
48
DAEMON_UTIL = _autoconf.PKGLIBDIR + "/daemon-util"
49
IMPORT_EXPORT_DAEMON = _autoconf.PKGLIBDIR + "/import-export"
50
KVM_CONSOLE_WRAPPER = _autoconf.PKGLIBDIR + "/tools/kvm-console-wrapper"
51
KVM_IFUP = _autoconf.PKGLIBDIR + "/kvm-ifup"
52
PREPARE_NODE_JOIN = _autoconf.PKGLIBDIR + "/prepare-node-join"
53
NODE_DAEMON_SETUP = _autoconf.PKGLIBDIR + "/node-daemon-setup"
54
XEN_CONSOLE_WRAPPER = _autoconf.PKGLIBDIR + "/tools/xen-console-wrapper"
47
DAEMON_UTIL = _constants.PKGLIBDIR + "/daemon-util"
48
IMPORT_EXPORT_DAEMON = _constants.PKGLIBDIR + "/import-export"
49
KVM_CONSOLE_WRAPPER = _constants.PKGLIBDIR + "/tools/kvm-console-wrapper"
50
KVM_IFUP = _constants.PKGLIBDIR + "/kvm-ifup"
51
PREPARE_NODE_JOIN = _constants.PKGLIBDIR + "/prepare-node-join"
52
NODE_DAEMON_SETUP = _constants.PKGLIBDIR + "/node-daemon-setup"
53
XEN_CONSOLE_WRAPPER = _constants.PKGLIBDIR + "/tools/xen-console-wrapper"
55 54
ETC_HOSTS = vcluster.ETC_HOSTS
56 55

  
57 56
# Top-level paths
b/qa/qa_cluster.py
27 27
import tempfile
28 28
import os.path
29 29

  
30
from ganeti import _autoconf
30
from ganeti import _constants
31 31
from ganeti import constants
32 32
from ganeti import compat
33 33
from ganeti import utils
......
1112 1112
      disks = qa_config.GetDiskOptions()
1113 1113
      # Run burnin
1114 1114
      cmd = ["env",
1115
             "PYTHONPATH=%s" % _autoconf.VERSIONEDSHAREDIR,
1115
             "PYTHONPATH=%s" % _constants.VERSIONEDSHAREDIR,
1116 1116
             script,
1117 1117
             "--os=%s" % qa_config.get("os"),
1118 1118
             "--minmem-size=%s" % qa_config.get(constants.BE_MINMEM),
b/qa/qa_monitoring.py
23 23

  
24 24
"""
25 25

  
26
from ganeti import _autoconf
26
from ganeti import _constants
27 27
from ganeti import constants
28 28

  
29 29
import qa_config
......
32 32
from qa_instance_utils import CreateInstanceByDiskTemplate, \
33 33
                              RemoveInstance
34 34

  
35
MON_COLLECTOR = _autoconf.PKGLIBDIR + "/mon-collector"
35
MON_COLLECTOR = _constants.PKGLIBDIR + "/mon-collector"
36 36

  
37 37

  
38 38
def TestInstStatusCollector():
b/test/py/daemon-util_unittest.bash
28 28
  exit 1
29 29
}
30 30

  
31
if ! grep -q '^ENABLE_CONFD = ' lib/_autoconf.py; then
31
if ! grep -q '^ENABLE_CONFD = ' lib/_constants.py; then
32 32
  err "Please update $0, confd enable feature is missing"
33 33
fi
34 34

  
35
if ! grep -q '^ENABLE_MOND = ' lib/_autoconf.py; then
35
if ! grep -q '^ENABLE_MOND = ' lib/_constants.py; then
36 36
  err "Please update $0, mond enable feature is missing"
37 37
fi
38 38

  
39 39
DAEMONS_LIST="noded masterd rapi"
40 40
STOPDAEMONS_LIST="rapi masterd noded"
41 41

  
42
if grep -q '^ENABLE_CONFD = True' lib/_autoconf.py; then
42
if grep -q '^ENABLE_CONFD = True' lib/_constants.py; then
43 43
  DAEMONS_LIST="$DAEMONS_LIST confd luxid"
44 44
  STOPDAEMONS_LIST="luxid confd $STOPDAEMONS_LIST"
45 45
fi
46 46

  
47
if grep -q '^ENABLE_MOND = True' lib/_autoconf.py; then
47
if grep -q '^ENABLE_MOND = True' lib/_constants.py; then
48 48
  DAEMONS_LIST="$DAEMONS_LIST mond"
49 49
  STOPDAEMONS_LIST="mond $STOPDAEMONS_LIST"
50 50
fi
b/test/py/docs_unittest.py
26 26
import itertools
27 27
import operator
28 28

  
29
from ganeti import _autoconf
29
from ganeti import _constants
30 30
from ganeti import utils
31 31
from ganeti import cmdlib
32 32
from ganeti import build
......
314 314
    return build.LoadModule("scripts/%s" % name)
315 315

  
316 316
  def test(self):
317
    for script in _autoconf.GNT_SCRIPTS:
317
    for script in _constants.GNT_SCRIPTS:
318 318
      self._CheckManpage(script,
319 319
                         self._ReadManFile(script),
320 320
                         self._LoadScript(script).commands.keys())

Also available in: Unified diff