Skip to content

Commit

Permalink
More changes suggested in the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj Shah committed Feb 15, 2018
1 parent 1b8f79f commit 213e333
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/managementgroups/azext_managementgroups/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
examples:
- name: Add a subscription to a management group.
text: >
az managementgroups group new --group-name GroupName --subscription <subscription>
az managementgroups group new --group-name GroupName --subscription Subscription
"""

helps['account management-group subscription remove'] = """
Expand All @@ -153,5 +153,5 @@
examples:
- name: Remove an existing subscription from a management group.
text: >
az managementgroups group remove --group-name GroupName --subscription <subscription>
az managementgroups group remove --group-name GroupName --subscription Subscription
"""
4 changes: 0 additions & 4 deletions src/managementgroups/azext_managementgroups/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
# --------------------------------------------------------------------------------------------
from azure.cli.core.commands.parameters import get_three_state_flag

# pylint: disable=line-too-long


def load_arguments(self, _):
with self.argument_context('account management-group') as c:
c.argument('group_name', options_list=['--group-name', '--name', '-n'])


with self.argument_context('account management-group show') as c:
c.argument('expand', arg_type=get_three_state_flag(), options_list=['--expand', '-e'])
c.argument('recurse', arg_type=get_three_state_flag(), options_list=['--recurse', '-r'])
Expand Down
10 changes: 3 additions & 7 deletions src/managementgroups/azext_managementgroups/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,18 @@


def load_command_table(self, _):
def managementgroups_type(*args, **kwargs):
return CliCommandType(
*args,
**kwargs)

managementgroups_sdk = managementgroups_type(
managementgroups_sdk = CliCommandType(
operations_tmpl='azext_managementgroups.managementgroups.operations.management_groups_operations#ManagementGroupsOperations.{}',
client_factory=management_groups_client_factory,
exception_handler=managementgroups_exception_handler)

managementgroups_subscriptions_sdk = managementgroups_type(
managementgroups_subscriptions_sdk = CliCommandType(
operations_tmpl='azext_managementgroups.managementgroups.operations.management_group_subscriptions_operations#ManagementGroupSubscriptionsOperations.{}',
client_factory=management_group_subscriptions_client_factory,
exception_handler=managementgroups_exception_handler)

managementgroups_update_type = managementgroups_type(
managementgroups_update_type = CliCommandType(
operations_tmpl='azext_managementgroups.custom#{}',
client_factory=management_group_subscriptions_client_factory,
exception_handler=managementgroups_exception_handler)
Expand Down
2 changes: 0 additions & 2 deletions src/managementgroups/azext_managementgroups/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ def _get_subscription_id_from_subscription(cli_ctx, subscription):
return sub['id']
from azure.cli.core.util import CLIError
raise CLIError("Subscription not found in the current context.")
return None


def cli_managementgroups_group_list(cmd, client):
_register_rp(cmd.cli_ctx)
Expand Down

0 comments on commit 213e333

Please sign in to comment.