Allow upgrade force option to take in subcloud groups

Minor modification on dc-client side to skip validate_force_params
in order to allow upgrade with a group of subcloud (added feature)
as well as with a single subcloud (existing feature)

Test Plan:

1. Verify --force option can be used to create a strategy for a single
offline subcloud.
2. Verify --force option can be used to create a strategy for a group
of offline subclouds.
3. Verify --force option can be used to create a strategy for a group of
offline and online subclouds.

Story: 2009725
Task: 44933
Depends-On: https://review.opendev.org/c/starlingx/distcloud/+/836396

Signed-off-by: BoYuan Chang <boyuan.chang@windriver.com>
Change-Id: I84842bcce20d97c54d918625691145ee6a95ee5d
This commit is contained in:
BoYuan Chang 2022-04-04 11:32:21 -05:00
parent 4a3f0acf2f
commit 84895c499e
1 changed files with 18 additions and 1 deletions

View File

@ -27,7 +27,24 @@ class SwUpgradeManagerMixin(object):
class CreateSwUpgradeStrategy(SwUpgradeManagerMixin,
sw_update_manager.CreateSwUpdateStrategy):
"""Create a software upgrade strategy."""
pass
def add_force_argument(self, parser):
parser.add_argument(
'--force',
required=False,
action='store_true',
help='Allow upgrade with the subcloud group \
rather than a single subcloud name/ID'
)
def get_parser(self, prog_name):
parser = super(CreateSwUpgradeStrategy,
self).get_parser(prog_name)
return parser
# override validate_force_params defined in CreateSwUpdateStrategy
def validate_force_params(self, parsed_args):
pass
class ShowSwUpgradeStrategy(SwUpgradeManagerMixin,