From patchwork Thu Oct 14 16:41:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Adri=C3=A1n_Moreno?= X-Patchwork-Id: 1541025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=Ve2xmlKQ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HVZtp6Cfyz9s0r for ; Fri, 15 Oct 2021 03:42:10 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 011A940650; Thu, 14 Oct 2021 16:42:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 67zF86POgFZB; Thu, 14 Oct 2021 16:42:08 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3B27B405C9; Thu, 14 Oct 2021 16:42:07 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 014F0C0011; Thu, 14 Oct 2021 16:42:07 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3C8B9C000D for ; Thu, 14 Oct 2021 16:42:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 289244054D for ; Thu, 14 Oct 2021 16:42:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IFkcy9Ff_RjD for ; Thu, 14 Oct 2021 16:42:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id B67E8403E0 for ; Thu, 14 Oct 2021 16:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634229721; 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=U2HPKBKDpLboDtcaljm8Z4jUdsDJzm58KKc9x92K9i8=; b=Ve2xmlKQZn0AXRHKtbL6V6SDIOu0JVIccHZ3UDfxVugUVuuQaYht1l+tjF50YSVsEJF36+ S7cNEYTO0VMsKS6j1KqZlYniW1OBM4lKhAygYCk8kcUqTv3Yx+HURBvcoJYrmzPDInrehm Tkk/1+VCK2khP8RP3YBuiZvEHT20Uho= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-XbA296iQMCm-2-KM-TbSEg-1; Thu, 14 Oct 2021 12:41:57 -0400 X-MC-Unique: XbA296iQMCm-2-KM-TbSEg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4B8F80574F for ; Thu, 14 Oct 2021 16:41:56 +0000 (UTC) Received: from amorenoz.users.ipa.redhat.com (unknown [10.39.193.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9148960583; Thu, 14 Oct 2021 16:41:55 +0000 (UTC) From: Adrian Moreno To: dev@openvswitch.org Date: Thu, 14 Oct 2021 18:41:28 +0200 Message-Id: <20211014164130.606220-4-amorenoz@redhat.com> In-Reply-To: <20211014164130.606220-1-amorenoz@redhat.com> References: <20211014164130.606220-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: dceara@redhat.com Subject: [ovs-dev] [RFC ovn 3/5] ovn-detrace: rename ovn-detrace to ovn_detrace.py 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" For external python programs to be able to load ovn-detrace as a python module easily, it should end in .py and should have underscores. Move ovn-detrace to ovn-detrac.py and create a symlink with the old name for backwards compatibility. Signed-off-by: Adrian Moreno --- debian/ovn-common.install | 2 +- debian/ovn-common.postinst | 1 + debian/ovn-common.postrm | 1 + rhel/ovn-fedora.spec.in | 9 +++++++++ utilities/automake.mk | 14 ++++++++++++-- utilities/{ovn-detrace.in => ovn_detrace.py.in} | 0 6 files changed, 24 insertions(+), 3 deletions(-) rename utilities/{ovn-detrace.in => ovn_detrace.py.in} (100%) diff --git a/debian/ovn-common.install b/debian/ovn-common.install index 8e5915724..050d1c63a 100644 --- a/debian/ovn-common.install +++ b/debian/ovn-common.install @@ -4,7 +4,7 @@ usr/bin/ovn-sbctl usr/bin/ovn-ic-nbctl usr/bin/ovn-ic-sbctl usr/bin/ovn-trace -usr/bin/ovn-detrace +usr/bin/ovn_detrace.py usr/share/ovn/scripts/ovn-ctl usr/share/ovn/scripts/ovndb-servers.ocf usr/share/ovn/scripts/ovn-lib diff --git a/debian/ovn-common.postinst b/debian/ovn-common.postinst index 15f3c7577..dfddb1f08 100644 --- a/debian/ovn-common.postinst +++ b/debian/ovn-common.postinst @@ -9,6 +9,7 @@ case "$1" in configure) mkdir -p /usr/lib/ocf/resource.d/ovn ln -sf /usr/share/ovn/scripts/ovndb-servers.ocf /usr/lib/ocf/resource.d/ovn/ovndb-servers + ln -sf /usr/bin/ovn_detrace.py /usr/bin/ovn-detrace ;; abort-upgrade|abort-remove|abort-deconfigure) ;; diff --git a/debian/ovn-common.postrm b/debian/ovn-common.postrm index 9face726b..d607a66d5 100644 --- a/debian/ovn-common.postrm +++ b/debian/ovn-common.postrm @@ -8,6 +8,7 @@ set -e case "$1" in purge|remove) rm -rf /usr/lib/ocf/resource.d/ovn + rm -f /usr/bin/ovn-detrace ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in index 9c8647b5a..fc0992263 100644 --- a/rhel/ovn-fedora.spec.in +++ b/rhel/ovn-fedora.spec.in @@ -264,6 +264,12 @@ if [ $1 -eq 1 ] ; then fi fi +%preun +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + rm %{_bindir}/ovn-detrace +fi + %preun central %if 0%{?systemd_preun:1} %systemd_preun ovn-northd.service @@ -318,6 +324,8 @@ fi %endif %post +ln -sf ovn_detrace.py %{_bindir}/ovn-detrace + %if %{with libcapng} if [ $1 -eq 1 ]; then sed -i 's:^#OVN_USER_ID=:OVN_USER_ID=:' %{_sysconfdir}/sysconfig/ovn @@ -462,6 +470,7 @@ fi %{_bindir}/ovn-nbctl %{_bindir}/ovn-sbctl %{_bindir}/ovn-trace +%{_bindir}/ovn_detrace.py %{_bindir}/ovn-detrace %{_bindir}/ovn-appctl %{_bindir}/ovn-ic-nbctl diff --git a/utilities/automake.mk b/utilities/automake.mk index a03892f20..67b04cbff 100644 --- a/utilities/automake.mk +++ b/utilities/automake.mk @@ -20,7 +20,7 @@ MAN_ROOTS += \ bin_SCRIPTS += \ utilities/ovn-docker-overlay-driver \ utilities/ovn-docker-underlay-driver \ - utilities/ovn-detrace + utilities/ovn_detrace.py EXTRA_DIST += \ utilities/ovn-ctl \ @@ -34,7 +34,7 @@ EXTRA_DIST += \ utilities/ovn-ic-sbctl.8.xml \ utilities/ovn-appctl.8.xml \ utilities/ovn-trace.8.xml \ - utilities/ovn-detrace.in \ + utilities/ovn_detrace.py.in \ utilities/ovndb-servers.ocf \ utilities/checkpatch.py \ utilities/docker/Makefile \ @@ -60,6 +60,7 @@ CLEANFILES += \ utilities/ovn-trace.8 \ utilities/ovn-detrace.1 \ utilities/ovn-detrace \ + utilities/ovn_detrace.py \ utilities/ovn-appctl.8 \ utilities/ovn-appctl \ utilities/ovn-sim @@ -105,4 +106,13 @@ bin_PROGRAMS += utilities/ovn-appctl utilities_ovn_appctl_SOURCES = utilities/ovn-appctl.c utilities_ovn_appctl_LDADD = lib/libovn.la $(OVSDB_LIBDIR)/libovsdb.la $(OVS_LIBDIR)/libopenvswitch.la +# ovn-detrace +INSTALL_DATA_LOCAL += ovn-detrace-install +ovn-detrace-install: + ln -sf ovn_detrace.py $(DESTDIR)$(bindir)/ovn-detrace + +UNINSTALL_LOCAL += ovn-detrace-uninstall +ovn-detrace-uninstall: + rm -f $(DESTDIR)$(bindir)/ovn-detrace + include utilities/bugtool/automake.mk diff --git a/utilities/ovn-detrace.in b/utilities/ovn_detrace.py.in similarity index 100% rename from utilities/ovn-detrace.in rename to utilities/ovn_detrace.py.in