Skip to content

Commit

Permalink
python: Remove hardcoded LXCPATH
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stgraber committed Dec 6, 2012
1 parent fe253ca commit 2495cc9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Expand Up @@ -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
Expand Down
Expand Up @@ -30,7 +30,7 @@
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
Expand Down
Expand Up @@ -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:
Expand Down

0 comments on commit 2495cc9

Please sign in to comment.