From 4b90f751cab018b88bd7015355ca0266cadf2067 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Fri, 12 Oct 2012 11:15:17 +0900 Subject: [PATCH] contrib/ovs/dirs: replace @variables@ which is replaced by configure Normally dirs.py is created from dirs.py.template by configure script. Create it manually for our own copy. Signed-off-by: Isaku Yamahata --- ryu/contrib/ovs/dirs.py | 13 +++++++++++++ ryu/contrib/ovs/dirs.py.template | 17 ----------------- 2 files changed, 13 insertions(+), 17 deletions(-) create mode 100644 ryu/contrib/ovs/dirs.py delete mode 100644 ryu/contrib/ovs/dirs.py.template diff --git a/ryu/contrib/ovs/dirs.py b/ryu/contrib/ovs/dirs.py new file mode 100644 index 00000000..de1605f1 --- /dev/null +++ b/ryu/contrib/ovs/dirs.py @@ -0,0 +1,13 @@ +import os +PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """/usr/share/openvswitch""") +RUNDIR = os.environ.get("OVS_RUNDIR", """/var/run/openvswitch""") +LOGDIR = os.environ.get("OVS_LOGDIR", """/var/log/openvswitch""") +BINDIR = os.environ.get("OVS_BINDIR", """/usr/bin""") + +DBDIR = os.environ.get("OVS_DBDIR") +if not DBDIR: + sysconfdir = os.environ.get("OVS_SYSCONFDIR") + if sysconfdir: + DBDIR = "%s/openvswitch" % sysconfdir + else: + DBDIR = """/etc/openvswitch""" diff --git a/ryu/contrib/ovs/dirs.py.template b/ryu/contrib/ovs/dirs.py.template deleted file mode 100644 index 370c69f4..00000000 --- a/ryu/contrib/ovs/dirs.py.template +++ /dev/null @@ -1,17 +0,0 @@ -## The @variables@ in this file are replaced by default directories for -## use in python/ovs/dirs.py in the source directory and replaced by the -## configured directories for use in the installed python/ovs/dirs.py. -## -import os -PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """@pkgdatadir@""") -RUNDIR = os.environ.get("OVS_RUNDIR", """@RUNDIR@""") -LOGDIR = os.environ.get("OVS_LOGDIR", """@LOGDIR@""") -BINDIR = os.environ.get("OVS_BINDIR", """@bindir@""") - -DBDIR = os.environ.get("OVS_DBDIR") -if not DBDIR: - sysconfdir = os.environ.get("OVS_SYSCONFDIR") - if sysconfdir: - DBDIR = "%s/openvswitch" % sysconfdir - else: - DBDIR = """@DBDIR@"""