From: Niklas Hambuechen <[email protected]>

The only reason why it was optional was its dependency on regex-pcre,
which was an optional Ganeti dependency.

Job filter rules require rexex-pcre unconditionally, so now confd
requires no additional depdendencies and can be built by default.
---
 Makefile.am                       | 17 ++++------------
 NEWS                              |  2 ++
 autotools/build-bash-completion   |  5 ++---
 configure.ac                      | 41 +--------------------------------------
 daemons/daemon-util.in            |  9 +--------
 lib/client/gnt_node.py            |  5 -----
 lib/cmdlib/cluster.py             |  3 ---
 lib/tools/burnin.py               |  5 +----
 lib/watcher/__init__.py           |  3 +--
 lib/watcher/nodemaint.py          |  4 ----
 src/AutoConf.hs.in                |  3 ---
 src/Ganeti/Constants.hs           |  3 ---
 test/py/daemon-util_unittest.bash | 13 ++-----------
 13 files changed, 14 insertions(+), 99 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6b36fe7..c3da105 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -349,10 +349,8 @@ GENERATED_FILES = \
 clean-local:
        rm -rf tools/shebang
 
-HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid
-if ENABLE_CONFD
-HS_GENERATED_FILES += src/hconfd src/ganeti-confd
-endif
+HS_GENERATED_FILES = $(HS_PROGS) src/hluxid src/ganeti-luxid \
+       src/hconfd src/ganeti-confd
 if ENABLE_MOND
 HS_GENERATED_FILES += src/ganeti-mond
 endif
@@ -714,12 +712,10 @@ endif
 HS_COMPILE_PROGS = \
        src/ganeti-kvmd \
        src/ganeti-wconfd \
+       src/hconfd \
        src/hluxid \
        src/hs2py \
        src/rpc-test
-if ENABLE_CONFD
-HS_COMPILE_PROGS += src/hconfd
-endif
 if ENABLE_MOND
 HS_COMPILE_PROGS += src/ganeti-mond
 endif
@@ -1325,6 +1321,7 @@ nodist_sbin_SCRIPTS = \
        daemons/ganeti-cleaner \
   src/ganeti-kvmd \
   src/ganeti-luxid \
+  src/ganeti-confd \
   src/ganeti-wconfd
 
 src/ganeti-luxid: src/hluxid
@@ -1335,13 +1332,9 @@ all_sbin_scripts = \
        $(patsubst tools/%,%,$(patsubst daemons/%,%,$(patsubst scripts/%,%,\
        $(patsubst src/%,%,$(dist_sbin_SCRIPTS) $(nodist_sbin_SCRIPTS)))))
 
-if ENABLE_CONFD
 src/ganeti-confd: src/hconfd
        cp -f $< $@
 
-nodist_sbin_SCRIPTS += src/ganeti-confd
-endif
-
 if ENABLE_MOND
 nodist_sbin_SCRIPTS += src/ganeti-mond
 endif
@@ -2207,7 +2200,6 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in 
$(PRINT_PY_CONSTANTS) \
            -DMOND_GROUP="$(MOND_GROUP)" \
            -DDISK_SEPARATOR="$(DISK_SEPARATOR)" \
            -DQEMUIMG_PATH="$(QEMUIMG_PATH)" \
-           -DENABLE_CONFD="$(ENABLE_CONFD)" \
            -DXEN_CMD="$(XEN_CMD)" \
            -DENABLE_RESTRICTED_COMMANDS="$(ENABLE_RESTRICTED_COMMANDS)" \
            -DENABLE_METADATA="$(ENABLE_METADATA)" \
@@ -2301,7 +2293,6 @@ $(REPLACE_VARS_SED): $(SHELL_ENV_INIT) Makefile 
stamp-directories
          echo 's#@''GNTMASTERDGROUP@#$(MASTERD_GROUP)#g'; \
          echo 's#@''GNTMONDGROUP@#$(MOND_GROUP)#g'; \
          echo 's#@''GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
-         echo 's#@''CUSTOM_ENABLE_CONFD@#$(ENABLE_CONFD)#g'; \
          echo 's#@''CUSTOM_ENABLE_MOND@#$(ENABLE_MOND)#g'; \
          echo 's#@''MODULES@#$(strip $(lint_python_code))#g'; \
          echo 's#@''XEN_CONFIG_DIR@#$(XEN_CONFIG_DIR)#g'; \
diff --git a/NEWS b/NEWS
index 49012a5..0ff2fa3 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,8 @@ New dependencies
 
 - The monitoring daemon uses the PSQueue library. Be sure to install it
   if you use Mond.
+- The formerly optional regex-pcre is now an unconditional dependency because
+  the new job filter rules have regular expressions as a core feature.
 
 
 Version 2.12.0
diff --git a/autotools/build-bash-completion b/autotools/build-bash-completion
index 855aeab..3e35ee1 100755
--- a/autotools/build-bash-completion
+++ b/autotools/build-bash-completion
@@ -900,9 +900,8 @@ def main():
     WriteHaskellCompletion(sw, script, htools=True, debug=debug)
 
   # ganeti-confd, if enabled
-  if _constants.ENABLE_CONFD:
-    WriteHaskellCompletion(sw, "src/ganeti-confd", htools=False,
-                           debug=debug)
+  WriteHaskellCompletion(sw, "src/ganeti-confd", htools=False,
+                         debug=debug)
 
   # mon-collector, if monitoring is enabled
   if _constants.ENABLE_MOND:
diff --git a/configure.ac b/configure.ac
index 22b1d08..8bcd72c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -607,14 +607,6 @@ then
   AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible])
 fi
 
-# --enable-confd
-ENABLE_CONFD=
-AC_ARG_ENABLE([confd],
-  [AS_HELP_STRING([--enable-confd],
-  [enable the ganeti-confd daemon (default: check)])],
-  [],
-  [enable_confd=check])
-
 ENABLE_MOND=
 AC_ARG_ENABLE([monitoring],
   [AS_HELP_STRING([--enable-monitoring],
@@ -680,35 +672,7 @@ AC_GHC_PKG_REQUIRE(hinotify)
 AC_GHC_PKG_REQUIRE(Crypto)
 AC_GHC_PKG_REQUIRE(lifted-base)
 AC_GHC_PKG_REQUIRE(lens)
-
-# extra modules for confd functionality; also needed for tests
-HS_NODEV=
-CONFD_PKG=
-# if a new confd dependency is needed, add it here like:
-# AC_GHC_PKG_CHECK([somepkg], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG somepkg"])
-HS_REGEX_PCRE=-DNO_REGEX_PCRE
-AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=],
-                 [HS_NODEV=1; CONFD_PKG="$CONFD_PKG regex-pcre"])
-
-has_confd=False
-if test "$enable_confd" != no; then
-  if test -z "$CONFD_PKG"; then
-    has_confd=True
-  elif test "$enable_confd" = check; then
-    AC_MSG_WARN(m4_normalize([The required extra libraries for confd were
-                              not found ($CONFD_PKG), confd disabled]))
-  else
-    AC_MSG_FAILURE(m4_normalize([The confd functionality was requested, but
-                                 required libraries were not found:
-                                 $CONFD_PKG]))
-  fi
-fi
-AC_SUBST(HS_REGEX_PCRE)
-if test "$has_confd" = True; then
-  AC_MSG_NOTICE([Enabling confd usage])
-fi
-AC_SUBST(ENABLE_CONFD, $has_confd)
-AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
+AC_GHC_PKG_REQUIRE(regex-pcre)
 
 #extra modules for monitoring daemon functionality; also needed for tests
 MONITORING_PKG=
@@ -720,9 +684,6 @@ AC_GHC_PKG_CHECK([PSQueue], [],
 has_monitoring=False
 if test "$enable_monitoring" != no; then
   MONITORING_DEP=
-  if test "$has_confd" = False; then
-    MONITORING_DEP="$MONITORING_DEP confd"
-  fi
   has_monitoring_pkg=False
   if test -z "$MONITORING_PKG"; then
     has_monitoring_pkg=True
diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
index 6a47253..eb71714 100644
--- a/daemons/daemon-util.in
+++ b/daemons/daemon-util.in
@@ -38,6 +38,7 @@ readonly defaults_file="$SYSCONFDIR/default/ganeti"
 # they're stopped in reverse order.
 DAEMONS=(
   ganeti-noded
+  ganeti-confd
   ganeti-wconfd
   ganeti-rapi
   ganeti-luxid
@@ -50,14 +51,6 @@ ON_DEMAND_DAEMONS=(
   ganeti-metad
   )
 
-_confd_enabled() {
-  [[ "@CUSTOM_ENABLE_CONFD@" == True ]]
-}
-
-if _confd_enabled; then
-  DAEMONS+=( ganeti-confd )
-fi
-
 _mond_enabled() {
   [[ "@CUSTOM_ENABLE_MOND@" == True ]]
 }
diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py
index 4127d77..bb88fb5 100644
--- a/lib/client/gnt_node.py
+++ b/lib/client/gnt_node.py
@@ -1059,11 +1059,6 @@ def ListDrbd(opts, args):
     ToStderr("Please give one (and only one) node.")
     return constants.EXIT_FAILURE
 
-  if not constants.ENABLE_CONFD:
-    ToStderr("Error: this command requires confd support, but it has not"
-             " been enabled at build time.")
-    return constants.EXIT_FAILURE
-
   status = ReplyStatus()
 
   def ListDrbdConfdCallback(reply):
diff --git a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py
index b7a205e..87f4105 100644
--- a/lib/cmdlib/cluster.py
+++ b/lib/cmdlib/cluster.py
@@ -1676,9 +1676,6 @@ class LUClusterSetParams(LogicalUnit):
       self.cluster.max_tracked_jobs = self.op.max_tracked_jobs
 
     if self.op.maintain_node_health is not None:
-      if self.op.maintain_node_health and not constants.ENABLE_CONFD:
-        feedback_fn("Note: CONFD was disabled at build time, node health"
-                    " maintenance is not useful (still enabling it)")
       self.cluster.maintain_node_health = self.op.maintain_node_health
 
     if self.op.modify_etc_hosts is not None:
diff --git a/lib/tools/burnin.py b/lib/tools/burnin.py
index 63f5a4c..8edd6fc 100755
--- a/lib/tools/burnin.py
+++ b/lib/tools/burnin.py
@@ -230,7 +230,7 @@ OPTIONS = [
                  const=[], default=[{}]),
   cli.cli_option("--no-confd", dest="do_confd_tests",
                  help="Skip confd queries",
-                 action="store_false", default=constants.ENABLE_CONFD),
+                 action="store_false", default=True),
   cli.cli_option("--rename", dest="rename", default=None,
                  help=("Give one unused instance name which is taken"
                        " to start the renaming sequence"),
@@ -1076,9 +1076,6 @@ class Burner(object):
       Err("When one node is available/selected the disk template must"
           " be one of %s" % utils.CommaJoin(_SINGLE_NODE_DISK_TEMPLATES))
 
-    if self.opts.do_confd_tests and not constants.ENABLE_CONFD:
-      Err("You selected confd tests but confd was disabled at configure time")
-
     has_err = True
     try:
       self.BurnCreateInstances()
diff --git a/lib/watcher/__init__.py b/lib/watcher/__init__.py
index 4ac5e31..6a32bf1 100644
--- a/lib/watcher/__init__.py
+++ b/lib/watcher/__init__.py
@@ -103,8 +103,7 @@ def StartNodeDaemons():
   # on master or not, try to start the node daemon
   utils.EnsureDaemon(constants.NODED)
   # start confd as well. On non candidates it will be in disabled mode.
-  if constants.ENABLE_CONFD:
-    utils.EnsureDaemon(constants.CONFD)
+  utils.EnsureDaemon(constants.CONFD)
   # start mond as well: all nodes need monitoring
   if constants.ENABLE_MOND:
     utils.EnsureDaemon(constants.MOND)
diff --git a/lib/watcher/nodemaint.py b/lib/watcher/nodemaint.py
index 7bbfd4e..ae021d9 100644
--- a/lib/watcher/nodemaint.py
+++ b/lib/watcher/nodemaint.py
@@ -137,10 +137,6 @@ class NodeMaintenance(object):
     """Check node status versus cluster desired state.
 
     """
-    if not constants.ENABLE_CONFD:
-      logging.warning("Confd use not enabled, cannot do maintenance")
-      return
-
     my_name = netutils.Hostname.GetSysName()
     req = \
       
confd.client.ConfdClientRequest(type=constants.CONFD_REQ_NODE_ROLE_BYNAME,
diff --git a/src/AutoConf.hs.in b/src/AutoConf.hs.in
index 83d0519..606ad04 100644
--- a/src/AutoConf.hs.in
+++ b/src/AutoConf.hs.in
@@ -235,9 +235,6 @@ qemuimgPath = "QEMUIMG_PATH"
 htools :: Bool
 htools = True
 
-enableConfd :: Bool
-enableConfd = ENABLE_CONFD
-
 xenCmd :: String
 xenCmd = "XEN_CMD"
 
diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs
index 6c95638..e7b59c2 100644
--- a/src/Ganeti/Constants.hs
+++ b/src/Ganeti/Constants.hs
@@ -334,9 +334,6 @@ adoptableBlockdevRoot = "/dev/disk/"
 
 -- * 'autoconf' enable/disable
 
-enableConfd :: Bool
-enableConfd = AutoConf.enableConfd
-
 enableMond :: Bool
 enableMond = AutoConf.enableMond
 
diff --git a/test/py/daemon-util_unittest.bash 
b/test/py/daemon-util_unittest.bash
index edaeac5..61a84d4 100755
--- a/test/py/daemon-util_unittest.bash
+++ b/test/py/daemon-util_unittest.bash
@@ -37,21 +37,12 @@ err() {
   exit 1
 }
 
-if ! grep -q '^ENABLE_CONFD = ' lib/_constants.py; then
-  err "Please update $0, confd enable feature is missing"
-fi
-
 if ! grep -q '^ENABLE_MOND = ' lib/_constants.py; then
   err "Please update $0, mond enable feature is missing"
 fi
 
-DAEMONS_LIST="noded wconfd rapi luxid kvmd"
-STOPDAEMONS_LIST="kvmd luxid rapi wconfd noded"
-
-if grep -q '^ENABLE_CONFD = True' lib/_constants.py; then
-  DAEMONS_LIST="$DAEMONS_LIST confd"
-  STOPDAEMONS_LIST="confd $STOPDAEMONS_LIST"
-fi
+DAEMONS_LIST="noded confd wconfd rapi luxid kvmd"
+STOPDAEMONS_LIST="kvmd luxid rapi confd wconfd noded"
 
 if grep -q '^ENABLE_MOND = True' lib/_constants.py; then
   DAEMONS_LIST="$DAEMONS_LIST mond"
-- 
2.1.3

Reply via email to