Skip to content

Commit 09eecf8

Browse files
authored
[Support] Fix error message and added missing conditions (#1567)
1 parent 17b6c96 commit 09eecf8

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/support/HISTORY.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
Release History
22
===============
33

4+
1.0.2
5+
-----
6+
* Removed custom error message in lieu of error message coming from backend.
7+
* Added missing condition for quota change request payload.
8+
49
1.0.1
510
-----
6-
* Remove resource id existence check in liue of backend based check
11+
* Remove resource id existence check in lieu of backend based check
712

813
1.0.0
914
-----

src/support/azext_support/_validators.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,14 @@ def _validate_communication_name(cmd, ticket_name, communication_name):
4444
rsp = client.check_name_availability(support_ticket_name=ticket_name, name=communication_name,
4545
type="Microsoft.Support/communications")
4646
if not rsp.name_available:
47-
raise CLIError("Support ticket communication name '{0}' not available. ".format(communication_name) +
48-
"Please try again with another name.")
47+
raise CLIError(rsp.message)
4948

5049

5150
def _validate_ticket_name(cmd, ticket_name):
5251
client = cf_support_tickets(cmd.cli_ctx)
5352
rsp = client.check_name_availability(name=ticket_name, type="Microsoft.Support/supportTickets")
5453
if not rsp.name_available:
55-
raise CLIError("Support ticket name '{0}' not available. ".format(ticket_name) +
56-
"Please try again with another name.")
54+
raise CLIError(rsp.message)
5755

5856

5957
def _validate_problem_classification_name(problem_classification_id):

src/support/azext_support/custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def create_support_tickets(cmd, client,
118118
start_date_time = start_date_time.strftime("%Y-%m-%dT%H:%M:%SZ")
119119
body["problem_start_time"] = start_date_time
120120

121-
if is_quota_ticket(service):
121+
if is_quota_ticket(service) and quota_change_version is not None:
122122
quotaBody = {}
123123
quotaBody["quota_change_request_sub_type"] = quota_change_subtype
124124
quotaBody["quota_change_request_version"] = quota_change_version
@@ -129,7 +129,7 @@ def create_support_tickets(cmd, client,
129129
quotaBody["quota_change_requests"] = quota_change_requests
130130
body["quota_ticket_details"] = quotaBody
131131

132-
if is_technical_ticket(service):
132+
if is_technical_ticket(service) and technical_resource is not None:
133133
body["technical_ticket_details"] = {"resource_id": technical_resource}
134134

135135
logger.debug("Sending create request with below payload: ")

src/support/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
logger.warn("Wheel is not available, disabling bdist_wheel hook")
1616

1717
# HISTORY.md entry.
18-
VERSION = '1.0.1'
18+
VERSION = '1.0.2'
1919

2020
# The full list of classifiers is available at
2121
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)