[ovs-dev] [PATCH] ovs-lib: pass optional --election-timer arg to ovsdb-tool

Dan Williams dcbw at redhat.com
Mon Jun 7 19:05:46 UTC 2021


On Mon, 2021-06-07 at 20:56 +0200, Ilya Maximets wrote:
> On 6/7/21 6:04 PM, Dan Williams wrote:
> > 
> > Signed-off-by: Dan Williams <dcbw at redhat.com>
> > ---
> >  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..d5aef8c85b3e0 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
> > create-cluster "$election_timer_arg" "$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 create-cluster "$election_timer_arg"
> > "$DB_FILE" "$backup" "$LOCAL_ADDR"
> 
> Shouldn't the option go before the command name?

ovsdb-tool doesn't seem to care, but I'll make the change in v2.

Dan

> 
> >      fi
> >  }
> >  
> > 
> 




More information about the dev mailing list