Skip to content

Commit

Permalink
Removed name property from update command (#1206)
Browse files Browse the repository at this point in the history
* Fixed

* run style fix

* reset launch

* Check

* Made id a required field
  • Loading branch information
roshan-sy authored Sep 17, 2021
1 parent fab8405 commit c5df216
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion azure-devops/azext_devops/dev/pipelines/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def load_build_arguments(self, _):

with self.argument_context('pipelines update') as context:
context.argument('yml_path', options_list=('--yml-path', '--yaml-path'))
context.argument('name', deprecate_info=context.deprecate(redirect='--id', target='--name', hide=True))

with self.argument_context('pipelines pool') as context:
context.argument('pool_id', options_list=('--pool-id', '--id'))
Expand Down
13 changes: 3 additions & 10 deletions azure-devops/azext_devops/dev/pipelines/pipeline_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
get_kubernetes_environment_resource, get_container_registry_service_connection, get_webapp_from_list_selection)
from azext_devops.dev.pipelines.pipeline_create_helpers.azure_repos_helper import push_files_to_azure_repo
from azext_devops.devops_sdk.v5_1.build.models import Build, BuildDefinition, BuildRepository, AgentPoolQueue
from .build_definition import get_definition_id_from_name, fix_path_for_api
from .build_definition import fix_path_for_api

logger = get_logger(__name__)

Expand Down Expand Up @@ -155,12 +155,10 @@ def pipeline_create(name, description=None, repository=None, branch=None, yml_pa
project=project)


def pipeline_update(name=None, id=None, description=None, new_name=None, # pylint: disable=redefined-builtin
def pipeline_update(id, description=None, new_name=None, # pylint: disable=redefined-builtin
branch=None, yml_path=None, queue_id=None, organization=None, project=None, detect=None,
new_folder_path=None):
""" Update a pipeline
:param name: Name of the pipeline to update.
:type name: str
"""Update a pipeline
:param id: Id of the pipeline to update.
:type id: str
:param new_name: New updated name of the pipeline.
Expand All @@ -181,11 +179,6 @@ def pipeline_update(name=None, id=None, description=None, new_name=None, # pyli
organization, project = resolve_instance_and_project(
detect=detect, organization=organization, project=project)
pipeline_client = get_new_pipeline_client(organization=organization)
if id is None:
if name is not None:
id = get_definition_id_from_name(name, pipeline_client, project)
else:
raise CLIError("Either --id or --name argument must be supplied for this command.")
definition = pipeline_client.get_definition(definition_id=id, project=project)
if new_name:
definition.name = new_name
Expand Down

0 comments on commit c5df216

Please sign in to comment.