Skip to content

Commit

Permalink
remove CLIError
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzelin007 committed Mar 25, 2022
1 parent 5de8273 commit ee9fd22
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import argparse
from collections import defaultdict
from knack.util import CLIError
from azure.cli.core.azclierror import ArgumentUsageError, InvalidArgumentValueError


class AddDesktopvirtualizationHostpoolCreateRegistrationInfo(argparse.Action):
Expand All @@ -31,7 +31,7 @@ def get_action(self, values, option_string):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
raise ArgumentUsageError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
Expand All @@ -47,7 +47,7 @@ def get_action(self, values, option_string):
d['registration_token_operation'] = v[0]

else:
raise CLIError(
raise InvalidArgumentValueError(
'Unsupported Key {} is provided for parameter registration-info. All possible keys are:'
' expiration-time, token, registration-token-operation'.format(k)
)
Expand All @@ -67,7 +67,7 @@ def get_action(self, values, option_string):
properties[k].append(v)
properties = dict(properties)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
raise ArgumentUsageError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
Expand All @@ -80,7 +80,7 @@ def get_action(self, values, option_string):
d['registration_token_operation'] = v[0]

else:
raise CLIError(
raise InvalidArgumentValueError(
'Unsupported Key {} is provided for parameter registration-info. All possible keys are:'
' expiration-time, registration-token-operation'.format(k)
)
Expand Down

0 comments on commit ee9fd22

Please sign in to comment.