From: Stéphane Graber Date: Wed, 5 Dec 2012 23:51:10 +0000 (-0500) Subject: python: Remove hardcoded LXCPATH X-Git-Tag: lxc-0.9.0.alpha1~1^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2495cc911b6600521fd2dc735edba15f6fbb9081;p=thirdparty%2Flxc.git python: Remove hardcoded LXCPATH Switch the python scripts to using @LXCPATH@. According to grep, this was the last occurence of a /var/*/lxc path in the code. Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/configure.ac b/configure.ac index 893e179ec..ef321ce47 100644 --- a/configure.ac +++ b/configure.ac @@ -271,6 +271,8 @@ AC_CONFIG_FILES([ src/lxc/legacy/lxc-ls src/python-lxc/Makefile + src/python-lxc/lxc/__init__.py + src/python-lxc/examples/api_test.py src/tests/Makefile diff --git a/src/python-lxc/examples/api_test.py b/src/python-lxc/examples/api_test.py.in similarity index 99% rename from src/python-lxc/examples/api_test.py rename to src/python-lxc/examples/api_test.py.in index 3ca02677b..0b17bd6ab 100644 --- a/src/python-lxc/examples/api_test.py +++ b/src/python-lxc/examples/api_test.py.in @@ -30,7 +30,7 @@ import uuid import sys # Some constants -LXC_PATH_LIB = "/var/lib/lxc" +LXC_PATH_LIB = "@LXCPATH@" LXC_TEMPLATE = "ubuntu" # Let's pick a random name, avoiding clashes diff --git a/src/python-lxc/lxc/__init__.py b/src/python-lxc/lxc/__init__.py.in similarity index 99% rename from src/python-lxc/lxc/__init__.py rename to src/python-lxc/lxc/__init__.py.in index cde4fd1e6..f42b9447e 100644 --- a/src/python-lxc/lxc/__init__.py +++ b/src/python-lxc/lxc/__init__.py.in @@ -465,7 +465,7 @@ def list_containers(as_object=False): List the containers on the system. """ containers = [] - for entry in glob.glob("/var/lib/lxc/*/config"): + for entry in glob.glob("@LXCPATH@/*/config"): if as_object: containers.append(Container(entry.split("/")[-2])) else: