All `AddCommand` child classes return the new register UUID

This patch fixes the return of two classes, ``HealthCheckAddCommand``
and ``GatewayChassisAddCommand``, that instead the new register UUID
were returning the register ifself.

NOTE:
* ``HealthCheckAddCommand`` is only used in ``LbAddHealthCheckCommand``
  (it has no IDL API method). It is tested in [1].
* ``GatewayChassisAddCommand`` is used in ``LrpAddCommand`` and
  ``LrpSetGatewayChassisCommand`` (it has no IDL API method). It is
  tested in [2] and [3].

[1]96cf8d6288/ovsdbapp/tests/functional/schema/ovn_northbound/test_impl_idl.py (L1731-L1762)
[2]96cf8d6288/ovsdbapp/tests/functional/schema/ovn_northbound/test_impl_idl.py (L1531-L1552)
[3]96cf8d6288/ovsdbapp/tests/functional/schema/ovn_northbound/test_impl_idl.py (L1505-L1516)

Closes-Bug: #2004170

Change-Id: I48df608aedce3012a2ae7aa4de636fa837bd47aa
This commit is contained in:
Rodolfo Alonso Hernandez 2023-01-24 08:42:44 +01:00 committed by Rodolfo Alonso
parent 7733f0c536
commit 019f0a2acb

View File

@ -1459,7 +1459,7 @@ class HealthCheckAddCommand(cmd.AddCommand):
hc = txn.insert(self.api.tables[self.table_name]) hc = txn.insert(self.api.tables[self.table_name])
hc.vip = self.vip hc.vip = self.vip
hc.options = self.options hc.options = self.options
self.result = hc self.result = hc.uuid
class HealthCheckSetOptionsCommand(cmd.BaseSetOptionsCommand): class HealthCheckSetOptionsCommand(cmd.BaseSetOptionsCommand):
@ -1749,7 +1749,7 @@ class GatewayChassisAddCommand(cmd.AddCommand):
gwc.chassis_name = self.chassis_name gwc.chassis_name = self.chassis_name
gwc.priority = self.priority gwc.priority = self.priority
self.set_columns(gwc, **self.columns) self.set_columns(gwc, **self.columns)
self.result = gwc self.result = gwc.uuid
class HAChassisGroupAddCommand(cmd.AddCommand): class HAChassisGroupAddCommand(cmd.AddCommand):