]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
python: Remove hardcoded LXCPATH
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 5 Dec 2012 23:51:10 +0000 (18:51 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 6 Dec 2012 14:43:33 +0000 (09:43 -0500)
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 <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
configure.ac
src/python-lxc/examples/api_test.py.in [moved from src/python-lxc/examples/api_test.py with 99% similarity]
src/python-lxc/lxc/__init__.py.in [moved from src/python-lxc/lxc/__init__.py with 99% similarity]

index 893e179ec2fa70a1121ce772d931810628b14de7..ef321ce47f9f9865c297d4cc078bee151745af1a 100644 (file)
@@ -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
 
similarity index 99%
rename from src/python-lxc/examples/api_test.py
rename to src/python-lxc/examples/api_test.py.in
index 3ca02677babe101502dd2f700c80d8e46771846b..0b17bd6ab39a008a871ee636bc3b75e09d9127e0 100644 (file)
@@ -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
similarity index 99%
rename from src/python-lxc/lxc/__init__.py
rename to src/python-lxc/lxc/__init__.py.in
index cde4fd1e652eb794ad66d62b0218372ee622a7e0..f42b9447e1917a67eab604f9da88b4e7243380a6 100644 (file)
@@ -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: