From patchwork Fri Jun 25 16:23:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 1497364 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.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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=XjDCxZwX; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 ozlabs.org (Postfix) with ESMTPS id 4GBMkQ6d3Mz9sX5 for ; Sat, 26 Jun 2021 02:23:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3379283E67; Fri, 25 Jun 2021 16:23:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2MJu5lLYCp0A; Fri, 25 Jun 2021 16:23:24 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 88C0983DF7; Fri, 25 Jun 2021 16:23:23 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5C71AC0010; Fri, 25 Jun 2021 16:23:23 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2A75FC000E for ; Fri, 25 Jun 2021 16:23:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 15B6642205 for ; Fri, 25 Jun 2021 16:23:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com 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 JSnKlUeliRig for ; Fri, 25 Jun 2021 16:23:21 +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 smtp4.osuosl.org (Postfix) with ESMTPS id 4092C421FF for ; Fri, 25 Jun 2021 16:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624638200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/DAXZbbxRAucNklOpYuAcOn8ooSpywEJ1S7OJm2Df8=; b=XjDCxZwXzUrqGM4RJ2i0j1O7ypulFDAnd+yNLA1vdRVuDCS6I5Ex/X73YELoSDw38QpAzj jsY3rxynS/2UwZiymAJQV2JV78yVK63f/DQzm047LpnverVr3ejwcjWnayVWWWCzxRnlAW Lk0FoCTXjBuHbTDT+HHTeg14dCuPg0w= 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-467-7or1hnUuMnGdMVrgH9ZO_Q-1; Fri, 25 Jun 2021 12:23:18 -0400 X-MC-Unique: 7or1hnUuMnGdMVrgH9ZO_Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2BAC1934102 for ; Fri, 25 Jun 2021 16:23:17 +0000 (UTC) Received: from localhost.localdomain (unknown [10.3.128.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51E151A86F for ; Fri, 25 Jun 2021 16:23:17 +0000 (UTC) Message-ID: <796297662d70498c459ffc97894e497067aee1b8.camel@redhat.com> From: Dan Williams To: ovs-dev@openvswitch.org Date: Fri, 25 Jun 2021 11:23:16 -0500 User-Agent: Evolution 3.40.2 (3.40.2-1.fc34) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dcbw@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v4] ovs-lib: pass optional --election-timer arg to ovsdb-tool 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" Signed-off-by: Dan Williams --- v4: fix quoting of election_timer_arg v3: fix line wrapping v2: put --election-timer arg before create-cluster utilities/ovs-lib.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index ab38ece458b7b..3eda01d3c1f33 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -495,15 +495,21 @@ create_cluster () { DB_FILE="$1" DB_SCHEMA="$2" LOCAL_ADDR="$3" + ELECTION_TIMER_MS="$4" + + election_timer_arg= + if [ -n "$ELECTION_TIMER_MS" ]; then + election_timer_arg="--election-timer=$ELECTION_TIMER_MS" + fi if test ! -e "$DB_FILE"; then - action "Creating cluster database $DB_FILE" ovsdb_tool create-cluster "$DB_FILE" "$DB_SCHEMA" "$LOCAL_ADDR" + action "Creating cluster database $DB_FILE" ovsdb_tool $election_timer_arg create-cluster "$DB_FILE" "$DB_SCHEMA" "$LOCAL_ADDR" elif ovsdb_tool db-is-standalone "$DB_FILE"; then # Convert standalone database to clustered. backup_db || return 1 rm -f "$DB_FILE" action "Creating cluster database $DB_FILE from existing one" \ - ovsdb_tool create-cluster "$DB_FILE" "$backup" "$LOCAL_ADDR" + ovsdb_tool $election_timer_arg create-cluster "$DB_FILE" "$backup" "$LOCAL_ADDR" fi }