Skip to content

Commit f1ac337

Browse files
Move deployments commands into separate file
1 parent c5bd23f commit f1ac337

File tree

84 files changed

+10597
-11988
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+10597
-11988
lines changed

src/azure-cli/azure/cli/command_modules/resource/_client_factory.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
76
def _resource_client_factory(cli_ctx, **_):
87
from azure.cli.core.commands.client_factory import get_mgmt_service_client
98
from azure.cli.core.profiles import ResourceType
109
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES)
1110

1211

12+
def _resource_deployments_client_factory(cli_ctx, **_):
13+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
14+
from azure.cli.core.profiles import ResourceType
15+
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES)
16+
17+
1318
def _resource_feature_client_factory(cli_ctx, **_):
1419
from azure.cli.core.commands.client_factory import get_mgmt_service_client
1520
from azure.cli.core.profiles import ResourceType
@@ -76,7 +81,7 @@ def _resource_privatelinks_client_factory(cli_ctx, **_):
7681
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_PRIVATELINKS)
7782

7883

79-
def cf_resource_groups(cli_ctx, _):
84+
def cf_resource_groups(cli_ctx, *_):
8085
return _resource_client_factory(cli_ctx).resource_groups
8186

8287

@@ -92,12 +97,16 @@ def cf_tags(cli_ctx, _):
9297
return _resource_client_factory(cli_ctx).tags
9398

9499

95-
def cf_deployments(cli_ctx, _):
96-
return _resource_client_factory(cli_ctx).deployments
100+
def cf_deployments(cli_ctx, *_):
101+
return _resource_deployments_client_factory(cli_ctx).deployments
97102

98103

99-
def cf_deployment_operations(cli_ctx, _):
100-
return _resource_client_factory(cli_ctx).deployment_operations
104+
def cf_deployment_operations(cli_ctx, *_):
105+
return _resource_deployments_client_factory(cli_ctx).deployment_operations
106+
107+
108+
def cf_deploymentscripts(cli_ctx, *_):
109+
return _resource_deploymentscripts_client_factory(cli_ctx).deployment_scripts
101110

102111

103112
def cf_features(cli_ctx, _):
@@ -128,10 +137,6 @@ def cf_resource_links(cli_ctx, _):
128137
return _resource_links_client_factory(cli_ctx).resource_links
129138

130139

131-
def cf_resource_deploymentscripts(cli_ctx, _):
132-
return _resource_deploymentscripts_client_factory(cli_ctx).deployment_scripts
133-
134-
135140
def cf_resource_managedapplications(cli_ctx, _):
136141
return _resource_managedapps_client_factory(cli_ctx).applications
137142

@@ -160,11 +165,11 @@ def cf_hierarchy_settings(cli_ctx, _):
160165
return _resource_managementgroups_client_factory(cli_ctx).hierarchy_settings
161166

162167

163-
def cf_resource_templatespecs(cli_ctx, _):
168+
def cf_resource_templatespecs(cli_ctx, *_):
164169
return _resource_templatespecs_client_factory(cli_ctx).template_specs
165170

166171

167-
def cf_resource_deploymentstacks(cli_ctx, _):
172+
def cf_resource_deploymentstacks(cli_ctx, *_):
168173
return _resource_deploymentstacks_client_factory(cli_ctx).deployment_stacks
169174

170175

src/azure-cli/azure/cli/command_modules/resource/_packing_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from knack.util import CLIError
99
from azure.cli.core.azclierror import BadRequestError
1010
from azure.cli.core.util import read_file_content, shell_safe_json_parse
11-
from azure.cli.command_modules.resource.custom import _remove_comments_from_json
11+
from azure.cli.command_modules.resource.custom_deployments import _remove_comments_from_json
1212
from azure.cli.core.profiles import ResourceType, get_sdk
1313

1414

src/azure-cli/azure/cli/command_modules/resource/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from azure.cli.command_modules.resource._client_factory import (
1717
cf_resource_groups, cf_providers, cf_features, cf_feature_registrations, cf_tags, cf_deployments,
1818
cf_deployment_operations, cf_policy_definitions, cf_policy_set_definitions, cf_policy_exemptions, cf_resource_links, cf_resource_deploymentstacks,
19-
cf_resource_deploymentscripts, cf_resource_managedapplications, cf_resource_managedappdefinitions, cf_management_groups, cf_management_groups_mixin, cf_management_group_subscriptions, cf_management_group_entities, cf_hierarchy_settings, cf_resource_templatespecs, cf_resource_resourcemanagementprivatelinks, cf_resource_privatelinkassociations)
19+
cf_deploymentscripts, cf_resource_managedapplications, cf_resource_managedappdefinitions, cf_management_groups, cf_management_groups_mixin, cf_management_group_subscriptions, cf_management_group_entities, cf_hierarchy_settings, cf_resource_templatespecs, cf_resource_resourcemanagementprivatelinks, cf_resource_privatelinkassociations)
2020
from azure.cli.command_modules.resource._validators import (
2121
process_deployment_create_namespace, process_ts_create_or_update_namespace, _validate_template_spec, _validate_template_spec_out,
2222
process_assign_identity_namespace, process_assignment_create_namespace, validate_deployment_stack_files)
@@ -200,7 +200,7 @@ def load_command_table(self, _):
200200

201201
resource_deploymentscripts_sdk = CliCommandType(
202202
operations_tmpl='azure.mgmt.resource.deploymentscripts.operations#ResourceLinksOperations.{}',
203-
client_factory=cf_resource_deploymentscripts,
203+
client_factory=cf_deploymentscripts,
204204
resource_type=ResourceType.MGMT_RESOURCE_DEPLOYMENTSCRIPTS
205205
)
206206

0 commit comments

Comments
 (0)