Revision 13718ded autotools/build-bash-completion

b/autotools/build-bash-completion
35 35
from ganeti import cli
36 36
from ganeti import utils
37 37
from ganeti import build
38
from ganeti import pathutils
38 39

  
39 40
# _autoconf shouldn't be imported from anywhere except constants.py, but we're
40 41
# making an exception here because this script is only used at build time.
......
79 80
  sw.Write("_ganeti_nodes() {")
80 81
  sw.IncIndent()
81 82
  try:
82
    node_list_path = os.path.join(constants.DATA_DIR, "ssconf_node_list")
83
    node_list_path = os.path.join(pathutils.DATA_DIR, "ssconf_node_list")
83 84
    sw.Write("cat %s 2>/dev/null || :", utils.ShellQuote(node_list_path))
84 85
  finally:
85 86
    sw.DecIndent()
......
88 89
  sw.Write("_ganeti_instances() {")
89 90
  sw.IncIndent()
90 91
  try:
91
    instance_list_path = os.path.join(constants.DATA_DIR,
92
    instance_list_path = os.path.join(pathutils.DATA_DIR,
92 93
                                      "ssconf_instance_list")
93 94
    sw.Write("cat %s 2>/dev/null || :", utils.ShellQuote(instance_list_path))
94 95
  finally:
......
101 102
    # FIXME: this is really going into the internals of the job queue
102 103
    sw.Write(("local jlist=$( shopt -s nullglob &&"
103 104
              " cd %s 2>/dev/null && echo job-* || : )"),
104
             utils.ShellQuote(constants.QUEUE_DIR))
105
             utils.ShellQuote(pathutils.QUEUE_DIR))
105 106
    sw.Write('echo "${jlist//job-/}"')
106 107
  finally:
107 108
    sw.DecIndent()
108 109
  sw.Write("}")
109 110

  
110 111
  for (fnname, paths) in [
111
    ("os", constants.OS_SEARCH_PATH),
112
    ("os", pathutils.OS_SEARCH_PATH),
112 113
    ("iallocator", constants.IALLOCATOR_SEARCH_PATH),
113 114
    ]:
114 115
    sw.Write("_ganeti_%s() {", fnname)
......
125 126
  sw.Write("_ganeti_nodegroup() {")
126 127
  sw.IncIndent()
127 128
  try:
128
    nodegroups_path = os.path.join(constants.DATA_DIR, "ssconf_nodegroups")
129
    nodegroups_path = os.path.join(pathutils.DATA_DIR, "ssconf_nodegroups")
129 130
    sw.Write("cat %s 2>/dev/null || :", utils.ShellQuote(nodegroups_path))
130 131
  finally:
131 132
    sw.DecIndent()
......
635 636

  
636 637
  # Burnin script
637 638
  burnin = build.LoadModule("tools/burnin")
638
  WriteCompletion(sw, "%s/burnin" % constants.TOOLSDIR, "_ganeti_burnin",
639
  WriteCompletion(sw, "%s/burnin" % pathutils.TOOLSDIR, "_ganeti_burnin",
639 640
                  opts=burnin.OPTIONS, args=burnin.ARGUMENTS)
640 641

  
641 642
  print buf.getvalue()

Also available in: Unified diff