Commit 3311e336 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Fix conflicting path values from 'configure'



Because the Hs2Py constant generation infrastructure is transitional,
there are two generated 'autoconf' modules, namely, 'src/AutoConf.hs'
and 'lib/_autoconf.py'.  However, conflicting values were being
generated for Haskell and Python concerning the variables
'OS_SEARCH_PATH', 'ES_SEARCH_PATH', and 'IALLOCATOR_SEARCH_PATH'.
This patch fixes this problem by placing these variables only on the
Haskell side and generate Python constants holding the correct value.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent a25fdde9
...@@ -1785,15 +1785,12 @@ lib/_autoconf.py: Makefile | stamp-directories ...@@ -1785,15 +1785,12 @@ lib/_autoconf.py: Makefile | stamp-directories
echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \ echo "SSH_LOGIN_USER = '$(SSH_LOGIN_USER)'"; \
echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \ echo "SSH_CONSOLE_USER = '$(SSH_CONSOLE_USER)'"; \
echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \ echo "EXPORT_DIR = '$(EXPORT_DIR)'"; \
echo "OS_SEARCH_PATH = [$(OS_SEARCH_PATH)]"; \
echo "ES_SEARCH_PATH = [$(ES_SEARCH_PATH)]"; \
echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \ echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
echo "XEN_CONFIG_DIR = '$(XEN_CONFIG_DIR)'"; \ echo "XEN_CONFIG_DIR = '$(XEN_CONFIG_DIR)'"; \
echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \ echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
echo "XEN_INITRD = '$(XEN_INITRD)'"; \ echo "XEN_INITRD = '$(XEN_INITRD)'"; \
echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \ echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \ echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
echo "KVM_PATH = '$(KVM_PATH)'"; \ echo "KVM_PATH = '$(KVM_PATH)'"; \
echo "IP_PATH = '$(IP_PATH)'"; \ echo "IP_PATH = '$(IP_PATH)'"; \
echo "SOCAT_PATH = '$(SOCAT)'"; \ echo "SOCAT_PATH = '$(SOCAT)'"; \
......
...@@ -97,8 +97,8 @@ AC_ARG_WITH([os-search-path], ...@@ -97,8 +97,8 @@ AC_ARG_WITH([os-search-path],
[comma separated list of directories to] [comma separated list of directories to]
[ search for OS images (default is /srv/ganeti/os)] [ search for OS images (default is /srv/ganeti/os)]
)], )],
[os_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`], [os_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/\1/g"`],
[os_search_path="'/srv/ganeti/os'"]) [os_search_path="/srv/ganeti/os"])
AC_SUBST(OS_SEARCH_PATH, $os_search_path) AC_SUBST(OS_SEARCH_PATH, $os_search_path)
# --with-extstorage-search-path=... # --with-extstorage-search-path=...
...@@ -109,8 +109,8 @@ AC_ARG_WITH([extstorage-search-path], ...@@ -109,8 +109,8 @@ AC_ARG_WITH([extstorage-search-path],
[ search for External Storage Providers] [ search for External Storage Providers]
[ (default is /srv/ganeti/extstorage)] [ (default is /srv/ganeti/extstorage)]
)], )],
[es_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`], [es_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/\1/g"`],
[es_search_path="'/srv/ganeti/extstorage'"]) [es_search_path="/srv/ganeti/extstorage"])
AC_SUBST(ES_SEARCH_PATH, $es_search_path) AC_SUBST(ES_SEARCH_PATH, $es_search_path)
# --with-iallocator-search-path=... # --with-iallocator-search-path=...
...@@ -120,8 +120,8 @@ AC_ARG_WITH([iallocator-search-path], ...@@ -120,8 +120,8 @@ AC_ARG_WITH([iallocator-search-path],
[comma separated list of directories to] [comma separated list of directories to]
[ search for instance allocators (default is $libdir/ganeti/iallocators)] [ search for instance allocators (default is $libdir/ganeti/iallocators)]
)], )],
[iallocator_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`], [iallocator_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/\1/g"`],
[iallocator_search_path="'$libdir/$PACKAGE_NAME/iallocators'"]) [iallocator_search_path="$libdir/$PACKAGE_NAME/iallocators"])
AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path) AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path)
# --with-xen-bootloader=... # --with-xen-bootloader=...
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
""" """
from ganeti import _autoconf from ganeti import _autoconf
from ganeti import _constants
from ganeti import compat from ganeti import compat
from ganeti import vcluster from ganeti import vcluster
...@@ -35,8 +36,8 @@ DEFAULT_SHARED_FILE_STORAGE_DIR = "/srv/ganeti/shared-file-storage" ...@@ -35,8 +36,8 @@ DEFAULT_SHARED_FILE_STORAGE_DIR = "/srv/ganeti/shared-file-storage"
DEFAULT_SHARED_FILE_STORAGE_DIR = \ DEFAULT_SHARED_FILE_STORAGE_DIR = \
vcluster.AddNodePrefix(DEFAULT_SHARED_FILE_STORAGE_DIR) vcluster.AddNodePrefix(DEFAULT_SHARED_FILE_STORAGE_DIR)
EXPORT_DIR = vcluster.AddNodePrefix(_autoconf.EXPORT_DIR) EXPORT_DIR = vcluster.AddNodePrefix(_autoconf.EXPORT_DIR)
OS_SEARCH_PATH = _autoconf.OS_SEARCH_PATH OS_SEARCH_PATH = _constants.OS_SEARCH_PATH
ES_SEARCH_PATH = _autoconf.ES_SEARCH_PATH ES_SEARCH_PATH = _constants.ES_SEARCH_PATH
SSH_CONFIG_DIR = _autoconf.SSH_CONFIG_DIR SSH_CONFIG_DIR = _autoconf.SSH_CONFIG_DIR
XEN_CONFIG_DIR = vcluster.AddNodePrefix(_autoconf.XEN_CONFIG_DIR) XEN_CONFIG_DIR = vcluster.AddNodePrefix(_autoconf.XEN_CONFIG_DIR)
SYSCONFDIR = vcluster.AddNodePrefix(_autoconf.SYSCONFDIR) SYSCONFDIR = vcluster.AddNodePrefix(_autoconf.SYSCONFDIR)
......
...@@ -50,6 +50,14 @@ import qualified Ganeti.Runtime as Runtime ...@@ -50,6 +50,14 @@ import qualified Ganeti.Runtime as Runtime
import Ganeti.Types import Ganeti.Types
import qualified Ganeti.Types as Types import qualified Ganeti.Types as Types
-- * Constants for 'lib/pathutils.py'
osSearchPath :: [String]
osSearchPath = AutoConf.osSearchPath
esSearchPath :: [String]
esSearchPath = AutoConf.esSearchPath
-- * OOB supported commands -- * OOB supported commands
oobPowerOn :: String oobPowerOn :: String
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment