diff options
| author | Ben Pfaff <blp@nicira.com> | 2010-11-29 12:28:26 -0800 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2010-11-29 16:29:11 -0800 |
| commit | b43c6fe279a5630dfbc0273e06bd1e8ca530ba35 (patch) | |
| tree | 0b3ccc94c79b5058006a0deb88e322364fd4232b /python/ovs/dirs.py | |
| parent | 614c4892032f424efa5f0ec404b2d499acad254d (diff) | |
| download | openvswitch-b43c6fe279a5630dfbc0273e06bd1e8ca530ba35.tar.gz | |
Make installation directories overridable at runtime.
This makes it possible to run tests that need access to installation
directories, such as the rundir, without having access to the actual
installation directories (/var/run is generally not world-writable), by
setting environment variables. This is not a good way to do things in
general--usually it would be better to choose the correct directories
at configure time--so for now this is undocumented.
Diffstat (limited to 'python/ovs/dirs.py')
| -rw-r--r-- | python/ovs/dirs.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/python/ovs/dirs.py b/python/ovs/dirs.py index f8e73087f..5b006cc3e 100644 --- a/python/ovs/dirs.py +++ b/python/ovs/dirs.py @@ -1,7 +1,8 @@ # These are the default directories. They will be replaced by the # configured directories at install time. -PKGDATADIR = "/usr/local/share/openvswitch" -RUNDIR = "/var/run" -LOGDIR = "/usr/local/var/log" -BINDIR = "/usr/local/bin" +import os +PKGDATADIR = os.environ.get("OVS_PKGDATADIR", "/usr/local/share/openvswitch") +RUNDIR = os.environ.get("OVS_RUNDIR", "/var/run") +LOGDIR = os.environ.get("OVS_LOGDIR", "/usr/local/var/log") +BINDIR = os.environ.get("OVS_BINDIR", "/usr/local/bin") |
