Revision 42ab9ac4

b/Makefile.am
1142 1142
	  echo "PY_CONFD = $(PY_CONFD)"; \
1143 1143
	  echo "HS_CONFD = $(HS_CONFD)"; \
1144 1144
	  echo "XEN_CMD = '$(XEN_CMD)'"; \
1145
	  echo "ENABLE_SPLIT_QUERY = $(ENABLE_SPLIT_QUERY)"; \
1145 1146
	} > $@
1146 1147

  
1147 1148
lib/_vcsversion.py: Makefile vcs-version | stamp-directories
......
1195 1196
	  echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
1196 1197
	  echo 's#@CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
1197 1198
	  echo 's#@MODULES@#$(strip $(lint_python_code))#g'; \
1199
	  echo 's#@ENABLE_SPLIT_QUERY@#$(ENABLE_SPLIT_QUERY)#g'; \
1198 1200
	} > $@
1199 1201

  
1200 1202
# Using deferred evaluation
b/configure.ac
288 288
        [],
289 289
        [enable_htools_rapi=no])
290 290

  
291
# --enable-htools
291
# --enable-confd
292 292
ENABLE_CONFD=
293 293
AC_ARG_ENABLE([confd],
294 294
  [AS_HELP_STRING([--enable-confd],
......
324 324
AM_CONDITIONAL([PY_CONFD], [test x$py_confd = xTrue])
325 325
AM_CONDITIONAL([HS_CONFD], [test x$hs_confd = xTrue])
326 326

  
327
# --enable-split-query
328
ENABLE_SPLIT_QUERY=
329
AC_ARG_ENABLE([split-query],
330
  [AS_HELP_STRING([--enable-split-query],
331
  [enable use of custom query daemon via Haskell confd])],
332
  [[case "$enableval" in
333
      no)
334
        enable_split_query=False
335
        ;;
336
      yes)
337
        enable_split_query=True
338
        ;;
339
      *)
340
        echo "Invalid value for enable-confd '$enableval'"
341
        exit 1
342
        ;;
343
    esac
344
  ]],
345
  [enable_split_query=False])
346
AC_SUBST(ENABLE_SPLIT_QUERY, $enable_split_query)
347

  
348
if test x$enable_split_query = xTrue -a x$hs_confd != xTrue; then
349
  AC_MSG_ERROR([Split queries require the Haskell confd])
350
fi
351

  
327 352
# --with-disk-separator=...
328 353
AC_ARG_WITH([disk-separator],
329 354
  [AS_HELP_STRING([--with-disk-separator=STRING],
b/lib/cli.py
2082 2082
      op.priority = _PRIONAME_TO_VALUE[options.priority]
2083 2083

  
2084 2084

  
2085
def GetClient():
2085
def GetClient(query=False):
2086
  """Connects to the a luxi socket and returns a client.
2087

  
2088
  @type query: boolean
2089
  @param query: this signifies that the client will only be
2090
      used for queries; if the build-time parameter
2091
      enable-split-queries is enabled, then the client will be
2092
      connected to the query socket instead of the masterd socket
2093

  
2094
  """
2095
  if query and constants.ENABLE_SPLIT_QUERY:
2096
    address = constants.QUERY_SOCKET
2097
  else:
2098
    address = None
2086 2099
  # TODO: Cache object?
2087 2100
  try:
2088
    client = luxi.Client()
2101
    client = luxi.Client(address=address)
2089 2102
  except luxi.NoMasterError:
2090 2103
    ss = ssconf.SimpleStore()
2091 2104

  
b/lib/client/gnt_cluster.py
334 334
  @return: the desired exit code
335 335

  
336 336
  """
337
  cl = GetClient()
337
  cl = GetClient(query=True)
338 338
  result = cl.QueryClusterInfo()
339 339
  ToStdout("Software version: %s", result["software_version"])
340 340
  ToStdout("Internode protocol: %s", result["protocol_version"])
b/lib/constants.py
175 175
USER_SCRIPTS_DIR = CONF_DIR + "/scripts"
176 176
ENABLE_CONFD = _autoconf.ENABLE_CONFD
177 177
HS_CONFD = _autoconf.HS_CONFD
178
ENABLE_SPLIT_QUERY = _autoconf.ENABLE_SPLIT_QUERY
178 179

  
179 180
#: Lock file for watcher, locked in shared mode by watcher; lock in exclusive
180 181
# mode to block watcher (see L{cli._RunWhileClusterStoppedHelper.Call}

Also available in: Unified diff