Skip to content

Commit

Permalink
RND-862 cfy dep gro update-deployments: handle no blueprint id (#1489)
Browse files Browse the repository at this point in the history
`blueprint_id in kwargs` is not correct here, because with click,
it's ALWAYS in kwargs, only sometimes it's None.

Ditto dont_update_plugins.

Also remove unused pass_context.
  • Loading branch information
tehasdf authored Jun 13, 2023
1 parent f027084 commit 4047fb8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cloudify_cli/commands/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,9 +1420,8 @@ def delete_group_labels(label, deployment_group_name,
@cfy.assert_manager_active()
@cfy.pass_client()
@cfy.pass_logger
@cfy.pass_context
def groups_update_deployments(ctx, group_id, logger, client, tenant_name,
concurrency, **kwargs):
def groups_update_deployments(group_id, logger, client, tenant_name,
concurrency, blueprint_id=None, **kwargs):
"""Update all deployments in the given group.
If updating with a new blueprint, the blueprint must already be
Expand All @@ -1434,11 +1433,11 @@ def groups_update_deployments(ctx, group_id, logger, client, tenant_name,
"""
utils.explicit_tenant_name_message(tenant_name, logger)
logger.info('Starting update of all deployments in group %s', group_id)
if 'blueprint_id' in kwargs:
if blueprint_id:
# check that the blueprint exists ahead of time, throw otherwise
client.blueprints.get(kwargs['blueprint_id'])
if 'dont_update_plugins' in kwargs:
kwargs['update_plugins'] = not kwargs.pop('dont_update_plugins')
client.blueprints.get(blueprint_id)
kwargs['blueprint_id'] = blueprint_id
kwargs['update_plugins'] = not kwargs.pop('dont_update_plugins')
execution_group = client.execution_groups.start(
deployment_group_id=group_id,
workflow_id='csys_update_deployment',
Expand Down

0 comments on commit 4047fb8

Please sign in to comment.