diff --git a/lib/constants.py b/lib/constants.py index e5a210c4d5e2503d71387df77ac74ee118c77581..0bcf70a8a2378760c72d3a294872ec5edd09d286 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -101,6 +101,7 @@ RAPI_USERS_FILE = DATA_DIR + "/rapi_users" QUEUE_DIR = DATA_DIR + "/queue" ETC_HOSTS = "/etc/hosts" DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR +SYSCONFDIR = _autoconf.SYSCONFDIR MASTER_SOCKET = SOCKET_DIR + "/ganeti-master" diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index 38ed993b35dd4ab8db01056dbee375aec2d77a99..23946839d4c484b3eb58bc30e3646007400fd981 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -76,6 +76,8 @@ class KVMHypervisor(hv_base.BaseHypervisor): _MIGRATION_STATUS_RE = re.compile('Migration\s+status:\s+(\w+)', re.M | re.I) + _KVM_NETWORK_SCRIPT = constants.SYSCONFDIR + "/ganeti/kvm-vif-bridge" + def __init__(self): hv_base.BaseHypervisor.__init__(self) # Let's make sure the directories we need exist, even if the RUN_DIR lives @@ -148,9 +150,9 @@ class KVMHypervisor(hv_base.BaseHypervisor): script.write("export BRIDGE=%s\n" % nic.bridge) script.write("export INTERFACE=$1\n") # TODO: make this configurable at ./configure time - script.write("if [ -x /etc/ganeti/kvm-vif-bridge ]; then\n") + script.write("if [ -x '%s' ]; then\n" % self._KVM_NETWORK_SCRIPT) script.write(" # Execute the user-specific vif file\n") - script.write(" /etc/ganeti/kvm-vif-bridge\n") + script.write(" %s\n" % self._KVM_NETWORK_SCRIPT) script.write("else\n") script.write(" # Connect the interface to the bridge\n") script.write(" /sbin/ifconfig $INTERFACE 0.0.0.0 up\n")