Commit c4dfb0b6 authored by Andrea Spadaccini's avatar Andrea Spadaccini Committed by Michael Hanselmann
Browse files

Added check for the ip command at configure time



Also, corrected a few places where the ip command was hardcoded.
Signed-off-by: default avatarAndrea Spadaccini <spadaccio@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent f8638e28
......@@ -886,6 +886,7 @@ lib/_autoconf.py: Makefile | lib/.dir
echo "ENABLE_SHARED_FILE_STORAGE = $(ENABLE_SHARED_FILE_STORAGE)"; \
echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
echo "KVM_PATH = '$(KVM_PATH)'"; \
echo "IP_PATH = '$(IP_PATH)'"; \
echo "SOCAT_PATH = '$(SOCAT)'"; \
echo "SOCAT_USE_ESCAPE = $(SOCAT_USE_ESCAPE)"; \
echo "SOCAT_USE_COMPRESS = $(SOCAT_USE_COMPRESS)"; \
......
......@@ -275,6 +275,14 @@ AC_SUBST(DISK_SEPARATOR, $disk_separator)
AC_PROG_INSTALL
AC_PROG_LN_S
# Check for the ip command
AC_ARG_VAR(IP_PATH, [ip path])
AC_PATH_PROG(IP_PATH, [ip], [])
if test -z "$IP_PATH"
then
AC_MSG_ERROR([ip command not found])
fi
# Check for pandoc
AC_ARG_VAR(PANDOC, [pandoc path])
AC_PATH_PROG(PANDOC, [pandoc], [])
......
......@@ -296,7 +296,7 @@ def StartMaster(start_daemons, no_voting):
if family == netutils.IP6Address.family:
ipcls = netutils.IP6Address
result = utils.RunCmd(["ip", "address", "add",
result = utils.RunCmd([constants.IP_COMMAND_PATH, "address", "add",
"%s/%d" % (master_ip, ipcls.iplen),
"dev", master_netdev, "label",
"%s:0" % master_netdev])
......@@ -343,7 +343,7 @@ def StopMaster(stop_daemons):
if family == netutils.IP6Address.family:
ipcls = netutils.IP6Address
result = utils.RunCmd(["ip", "address", "del",
result = utils.RunCmd([constants.IP_COMMAND_PATH, "address", "del",
"%s/%d" % (master_ip, ipcls.iplen),
"dev", master_netdev])
if result.failed:
......
......@@ -568,6 +568,7 @@ NODE_MAX_CLOCK_SKEW = 150
DISK_TRANSFER_CONNECT_TIMEOUT = 60
# Disk index separator
DISK_SEPARATOR = _autoconf.DISK_SEPARATOR
IP_COMMAND_PATH = _autoconf.IP_PATH
#: Key for job IDs in opcode result
JOB_IDS_KEY = "jobs"
......
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