From e5395072b6dc895cf23a4c9a34421429352e716e Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 31 Mar 2011 12:49:07 +0200
Subject: [PATCH] Expose whether htools was enabled to Python code

This exports whether htools was enabled at configure-time, and adds a
constant for our reference iallocator.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 Makefile.am      | 5 +++++
 lib/constants.py | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 68e18aacc..7574b7d8a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -869,6 +869,11 @@ lib/_autoconf.py: Makefile vcs-version | lib/.dir
 	  echo "NODED_USER = '$(NODED_USER)'"; \
 	  echo "VCS_VERSION = '$$VCSVER'"; \
 	  echo "DISK_SEPARATOR = '$(DISK_SEPARATOR)'"; \
+	  if [ "$(HTOOLS)" ]; then \
+	    echo "HTOOLS = True"; \
+	  else \
+	    echo "HTOOLS = False"; \
+	  fi; \
 	} > $@
 
 $(REPLACE_VARS_SED): Makefile
diff --git a/lib/constants.py b/lib/constants.py
index 973914b7e..71338762f 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -1329,3 +1329,8 @@ VALID_ALLOC_POLICIES = [
 
 # Temporary external/shared storage parameters
 BLOCKDEV_DRIVER_MANUAL = "manual"
+
+# Whether htools was enabled at compilation time
+HTOOLS = _autoconf.HTOOLS
+# The hail iallocator
+IALLOC_HAIL = "hail"
-- 
GitLab