Add default value to snapshot parameter in VIM sw create strategy API

Currently the VIM API does not have a default value for the snapshot
parameter in the sw update strategy create operation, causing that if
the VIM client does not provide it, the VIM API raises an error.
That is a side-effect produced by a previously merged commit, which was
created to support the sw strategy for N-1 use cases.

https://review.opendev.org/c/starlingx/nfv/+/962203

This commit add the default value None to the snapshot parameter
in the VIM API, covering the case when the client does not provide
it and allowing the VIM to create the strategy.

Test Plan:
PASS: - Run VIM sw create strategy without snapshot parameter
PASS: - Run VIM sw create strategy with snapshot parameter

Closes-bug: 2125230

Change-Id: I9b91f3f65089b118223cf864709d313ec9f6e369
Signed-off-by: Cristian Mondo <cristian.mondo@windriver.com>
This commit is contained in:
Cristian Mondo
2025-10-03 14:51:25 -03:00
parent f4b27388f2
commit cac1971229

View File

@@ -159,7 +159,7 @@ class SwUpgradeStrategyCreateData(wsme_types.Base):
delete = wsme_types.wsattr(bool, mandatory=False,
name='delete')
snapshot = wsme_types.wsattr(bool, mandatory=False,
name='snapshot')
name='snapshot', default=None)
storage_apply_type = wsme_types.wsattr(SwUpdateApplyTypes, mandatory=True,
name='storage-apply-type')
worker_apply_type = wsme_types.wsattr(SwUpdateApplyTypes, mandatory=True,