On 2/27/25 18:23, Terry Wilson wrote:
> When inserting a Row with persist_uuid=True, the Row will have
> a 'uuid' element and not a 'named-uuid' element, so ensure that
> other operations in the transaction refer to the row by 'uuid'.
> 
> Signed-off-by: Terry Wilson <[email protected]>
> ---
>  python/ovs/db/idl.py |  2 +-
>  tests/ovsdb-idl.at   | 12 ++++++++++--
>  tests/test-ovsdb.c   | 28 +++++++++++++++++++++++++++-
>  tests/test-ovsdb.py  | 11 +++++++++++
>  4 files changed, 49 insertions(+), 4 deletions(-)
> 
> diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py
> index abb82154b..384428c3f 100644
> --- a/python/ovs/db/idl.py
> +++ b/python/ovs/db/idl.py
> @@ -1731,7 +1731,7 @@ class Transaction(object):
>                      and ovs.ovsuuid.is_valid_string(json[1])):
>                  uuid = ovs.ovsuuid.from_string(json[1])
>                  row = self._txn_rows.get(uuid, None)
> -                if row and row._data is None:
> +                if row and row._data is None and not row._persist_uuid:
>                      return ["named-uuid", _uuid_name_from_uuid(uuid)]
>              else:
>                  return [self._substitute_uuids(elem) for elem in json]
> diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at
> index 5244358e3..638169ce6 100644
> --- a/tests/ovsdb-idl.at
> +++ b/tests/ovsdb-idl.at
> @@ -2826,7 +2826,7 @@ m4_define([OVSDB_CHECK_IDL_PERS_UUID_INSERT_C],
>              [0], [stdout], [stderr])
>     AT_CHECK([sort stdout],
>              [0], [$3])
> -   AT_CHECK([grep $4 stderr], [0], [ignore])
> +   m4_if([$4], [AT_CHECK([grep $4 stderr])], [0], [ignore])
>     OVSDB_SERVER_SHUTDOWN
>     AT_CLEANUP])
>  
> @@ -2838,7 +2838,7 @@ m4_define([OVSDB_CHECK_IDL_PERS_UUID_INSERT_PY],
>              [0], [stdout], [stderr])
>     AT_CHECK([sort stdout],
>              [0], [$3])
> -   AT_CHECK([grep $4 stderr], [0], [ignore])
> +   m4_if([$4], [AT_CHECK([grep $4 stderr])], [0], [ignore])

This is not a valid syntax.  The signature of the m4_if is:

  m4_if (string-1, string-2, equal, [not-equal])

See 
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Redefined-M4-Macros.html#Redefined-M4-Macros

So, I replaced this and the previous one with the following:

  m4_if([$4], [], [], [AT_CHECK([grep $4 stderr], [0], [ignore])])

i.e. compare the $4 with an empty string, do nothing if equals and perform
AT_CHECK otherwise.

With that and adding a missing semicolon in the subject line, I applied the set.
Also backported down to 3.2.

Thanks for the fixes!

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to