Skip to content

Commit

Permalink
remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
FanQiu committed Sep 3, 2019
1 parent fb90a69 commit 928c668
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/network/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
short-summary: Assign a managed service identity to an application-gateway
examples:
- name: Assign an identity to the application gateway
text: az network application-gateway identity assign -g MyResourceGroup --gateway-name ag1 --identity-type UserAssigned \\
text: az network application-gateway identity assign -g MyResourceGroup --gateway-name ag1 \\
--identity /subscriptions/*-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1
"""

Expand Down
22 changes: 0 additions & 22 deletions src/azure-cli/azure/cli/command_modules/network/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,28 +383,6 @@ def assign_ag_identity(cmd, resource_group_name, application_gateway_name,
return sdk_no_wait(no_wait, ncf.create_or_update, resource_group_name, application_gateway_name, ag)


# Unused due to service limitation.
def add_ag_identity(cmd, resource_group_name, application_gateway_name,
no_wait=False, user_assigned_identity=None,
client_id=None, principal_id=None):
ncf = network_client_factory(cmd.cli_ctx).application_gateways
ag = ncf.get(resource_group_name, application_gateway_name)
if ag.identity is None:
raise CLIError("Please first use 'az network application-gateway identity assign` to init the identity.")
ManagedServiceIdentityUserAssignedIdentitiesValue = \
cmd.get_models('ManagedServiceIdentityUserAssignedIdentitiesValue')
user_assigned_indentity_instance = ManagedServiceIdentityUserAssignedIdentitiesValue(
client_id=client_id,
principal_id=principal_id
)
if ag.identity.user_assigned_identities is not None:
ag.identity.user_assigned_identities[user_assigned_identity] = user_assigned_indentity_instance
else:
logger.warning("This command will be ignored. Please check the type of the identity.")

return sdk_no_wait(no_wait, ncf.create_or_update, resource_group_name, application_gateway_name, ag)


def remove_ag_identity(cmd, resource_group_name, application_gateway_name, no_wait=False):
ncf = network_client_factory(cmd.cli_ctx).application_gateways
ag = ncf.get(resource_group_name, application_gateway_name)
Expand Down

0 comments on commit 928c668

Please sign in to comment.