Skip to content

Commit df97ca8

Browse files
committed
[AppService] az webapp troubleshoot status: Clarify previous instance records
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb
1 parent 453aafe commit df97ca8

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

‎src/azure-cli/azure/cli/command_modules/appservice/_troubleshoot_status_report.py‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,15 @@ def emit(*objs):
143143
for inst in instances:
144144
_emit_instance_section(inst, emit)
145145

146+
if orphan_startups:
147+
emit((Style.PRIMARY,
148+
'Below startup records are from instances that no longer host the application '
149+
'but occurred within the last 24 hours. Limited to 5 instances.'))
150+
emit()
151+
146152
for orphan in orphan_startups[:_MAX_ORPHAN_STARTUPS]:
147153
_emit_orphan_startup(orphan, emit)
148154

149-
omitted_orphans = len(orphan_startups) - _MAX_ORPHAN_STARTUPS
150-
if omitted_orphans > 0:
151-
summary_label = 'summary' if omitted_orphans == 1 else 'summaries'
152-
emit((Style.WARNING, '{} additional orphan startup {} omitted.'.format(
153-
omitted_orphans, summary_label)))
154-
emit()
155-
156155
_emit_hint_footer(instances, app_name, resource_group, emit)
157156

158157

‎src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,10 @@ def test_troubleshoot_status_report_limits_orphan_startups(self):
21252125
for index in range(5):
21262126
self.assertIn('Instance orphan-{} Startup Summary'.format(index), rendered)
21272127
self.assertNotIn('Instance orphan-5 Startup Summary', rendered)
2128-
self.assertIn('1 additional orphan startup summary omitted.', rendered)
2128+
self.assertIn(
2129+
'Below startup records are from instances that no longer host the application '
2130+
'but occurred within the last 24 hours. Limited to 5 instances.',
2131+
rendered)
21292132

21302133
def test_transform_troubleshoot_status_output_renders_error_columns(self):
21312134
# Regression: the LastError* columns exercise _format_dt only when

0 commit comments

Comments
 (0)