From patchwork Wed Nov 11 09:25:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Gray X-Patchwork-Id: 1398096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LJJqe5Za; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CWK8s4W0pz9sSs for ; Wed, 11 Nov 2020 20:25:49 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1D55B85660; Wed, 11 Nov 2020 09:25:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6Xa5wULFXUSS; Wed, 11 Nov 2020 09:25:46 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4FC1085683; Wed, 11 Nov 2020 09:25:46 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 26764C0889; Wed, 11 Nov 2020 09:25:46 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id E6558C016F for ; Wed, 11 Nov 2020 09:25:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E1FF785701 for ; Wed, 11 Nov 2020 09:25:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VAsI-BCSJJMF for ; Wed, 11 Nov 2020 09:25:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 7D84E85660 for ; Wed, 11 Nov 2020 09:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605086741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GFRnf0BgsBP8f2zl/HNiyS8C/YZeXfIoSG727ahLFjg=; b=LJJqe5ZaZtoHOye5ixrCoeEec6eRlLxjSyTc979LRx7VXP/mLIbXLvT1/4wALaIGlHjUd6 95Qbae4TkosAK9iUacKPMBEviWPZCD1QykJsU0JDNrAhtkn8CC1BVvsp+0HCfhe4UtzaSD ifrFEVhIHFlLKymCc2p7UXTfgHzzsB0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-35-yuseQOxjPkOYUxeuKa9qLw-1; Wed, 11 Nov 2020 04:25:40 -0500 X-MC-Unique: yuseQOxjPkOYUxeuKa9qLw-1 Received: by mail-wm1-f69.google.com with SMTP id b206so546646wmd.3 for ; Wed, 11 Nov 2020 01:25:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GFRnf0BgsBP8f2zl/HNiyS8C/YZeXfIoSG727ahLFjg=; b=LhBiTNxo7miwnoGqvojrr9xkAkm9dqUcySqvU4itVzh3rJQhop+OnkYExZrgYxefS5 yNghnB3PvipS9vMlGNYCB1ZdAAswCBuuVGbGsgfIU0aSL+SEJo8BzFXCjoPEWxlFbJ18 Bvfdgfv7TkQhcdp20ZYHr5GSXjtr8ugWfMxF723DdG3YWQ7E0uFTKah/wXlEZWt3I8cr 4SrBwDyxDGX5xDYzFufpzUS0fDDOmsxG0rJtV3APL6yGb5kSPzgD4SYrIC+R9NHPwN+7 izmFlVzJ7xCktZC1a23vhpt5deXMHuQhLql/+8oL+UXhVRxCOoA04Mcwafv8Lzu7Cp14 DG1A== X-Gm-Message-State: AOAM530BrlqeLH8cU/8mQQ68Zgfa4GkzSn5YVCS1JaLEMKtU1+k+weJ8 KMtjRq2dE3cz7sL80bZDzwMLHrxF0Fo41Da9ALVMFxFmJtZLk64s1bS6G4rh2rJjc9PH56sOozT ICO8shr1DoT+L3rFeX+ShakQFnKh2Nv41bvqqImx6armAtz+wEWSDoO2Gec2bP2PTDRpAJ68J7A == X-Received: by 2002:a05:600c:218a:: with SMTP id e10mr3046940wme.73.1605086738557; Wed, 11 Nov 2020 01:25:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/abgKBBeaQ9Nx4F1xPbhrMBlGaePQqqyAKcNZyVaxvzl09BUFRBKztJnk3q+6Hbym3zHAiw== X-Received: by 2002:a05:600c:218a:: with SMTP id e10mr3046915wme.73.1605086738308; Wed, 11 Nov 2020 01:25:38 -0800 (PST) Received: from wsfd-netdev77.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id t15sm1766901wmn.19.2020.11.11.01.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 01:25:37 -0800 (PST) From: Mark Gray To: ovs-dev@openvswitch.org Date: Wed, 11 Nov 2020 04:25:30 -0500 Message-Id: <20201111092530.136929-3-mark.d.gray@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201111092530.136929-1-mark.d.gray@redhat.com> References: <20201111092530.136929-1-mark.d.gray@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mark.d.gray@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: eric@garver.life Subject: [ovs-dev] [PATCH v4 2/2] python: set ovs.dirs variables with build system values X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" ovs/dirs.py should be auto-generated using the template ovs/dirs.py.template at build time. This will set the ovs.dirs python variables with a value specified by the environment or, if the environment variable is not set, from the build system. Signed-off-by: Mark Gray Acked-By: Timothy Redaelli --- lib/automake.mk | 2 +- python/automake.mk | 13 +++++++------ python/ovs/.gitignore | 1 + python/ovs/dirs.py | 31 ------------------------------- 4 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 python/ovs/dirs.py diff --git a/lib/automake.mk b/lib/automake.mk index 380a672287ac..8eeb6c3f676c 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -575,7 +575,7 @@ MAN_FRAGMENTS += \ OVSIDL_BUILT += lib/vswitch-idl.c lib/vswitch-idl.h lib/vswitch-idl.ovsidl EXTRA_DIST += lib/vswitch-idl.ann -lib/vswitch-idl.ovsidl: vswitchd/vswitch.ovsschema lib/vswitch-idl.ann +lib/vswitch-idl.ovsidl: vswitchd/vswitch.ovsschema lib/vswitch-idl.ann python/ovs/dirs.py $(AM_V_GEN)$(OVSDB_IDLC) annotate $(srcdir)/vswitchd/vswitch.ovsschema $(srcdir)/lib/vswitch-idl.ann > $@.tmp && mv $@.tmp $@ lib/dirs.c: lib/dirs.c.in Makefile diff --git a/python/automake.mk b/python/automake.mk index 2f08c7701484..c4382ec60928 100644 --- a/python/automake.mk +++ b/python/automake.mk @@ -107,12 +107,13 @@ ALL_LOCAL += $(srcdir)/python/ovs/dirs.py $(srcdir)/python/ovs/dirs.py: python/ovs/dirs.py.template $(AM_V_GEN)sed \ -e '/^##/d' \ - -e 's,[@]pkgdatadir[@],/usr/local/share/openvswitch,g' \ - -e 's,[@]RUNDIR[@],/var/run,g' \ - -e 's,[@]LOGDIR[@],/usr/local/var/log,g' \ - -e 's,[@]bindir[@],/usr/local/bin,g' \ - -e 's,[@]sysconfdir[@],/usr/local/etc,g' \ - -e 's,[@]DBDIR[@],/usr/local/etc/openvswitch,g' \ + -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ + -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ + -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ + -e 's,[@]bindir[@],$(bindir),g' \ + -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ + -e 's,[@]DBDIR[@],$(sysconfdir)/openvswitch,g' \ < $? > $@.tmp && \ mv $@.tmp $@ EXTRA_DIST += python/ovs/dirs.py.template +CLEANFILES += python/ovs/dirs.py diff --git a/python/ovs/.gitignore b/python/ovs/.gitignore index 98527864664d..51030beca437 100644 --- a/python/ovs/.gitignore +++ b/python/ovs/.gitignore @@ -1 +1,2 @@ version.py +dir.py diff --git a/python/ovs/dirs.py b/python/ovs/dirs.py deleted file mode 100644 index c67aecbb46da..000000000000 --- a/python/ovs/dirs.py +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# 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 - -# Note that the use of """ is to aid in dealing with paths with quotes in them. -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""") - -DBDIR = os.environ.get("OVS_DBDIR") -if not DBDIR: - sysconfdir = os.environ.get("OVS_SYSCONFDIR") - if sysconfdir: - DBDIR = "%s/openvswitch" % sysconfdir - else: - DBDIR = """/usr/local/etc/openvswitch"""