Skip to content

Commit 4047fb8

Browse files
authored
RND-862 cfy dep gro update-deployments: handle no blueprint id (#1489)
`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.
1 parent f027084 commit 4047fb8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

cloudify_cli/commands/deployments.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,9 +1420,8 @@ def delete_group_labels(label, deployment_group_name,
14201420
@cfy.assert_manager_active()
14211421
@cfy.pass_client()
14221422
@cfy.pass_logger
1423-
@cfy.pass_context
1424-
def groups_update_deployments(ctx, group_id, logger, client, tenant_name,
1425-
concurrency, **kwargs):
1423+
def groups_update_deployments(group_id, logger, client, tenant_name,
1424+
concurrency, blueprint_id=None, **kwargs):
14261425
"""Update all deployments in the given group.
14271426
14281427
If updating with a new blueprint, the blueprint must already be
@@ -1434,11 +1433,11 @@ def groups_update_deployments(ctx, group_id, logger, client, tenant_name,
14341433
"""
14351434
utils.explicit_tenant_name_message(tenant_name, logger)
14361435
logger.info('Starting update of all deployments in group %s', group_id)
1437-
if 'blueprint_id' in kwargs:
1436+
if blueprint_id:
14381437
# check that the blueprint exists ahead of time, throw otherwise
1439-
client.blueprints.get(kwargs['blueprint_id'])
1440-
if 'dont_update_plugins' in kwargs:
1441-
kwargs['update_plugins'] = not kwargs.pop('dont_update_plugins')
1438+
client.blueprints.get(blueprint_id)
1439+
kwargs['blueprint_id'] = blueprint_id
1440+
kwargs['update_plugins'] = not kwargs.pop('dont_update_plugins')
14421441
execution_group = client.execution_groups.start(
14431442
deployment_group_id=group_id,
14441443
workflow_id='csys_update_deployment',

0 commit comments

Comments
 (0)