Azure / Azure/azure-cli-extensions

[connectedk8s] Escaping newlines in python strings produces weird spaces in cli error messages

Open
#7,577 2 comments 0 reactions 0 assignees View on GitHub
Auto-Assign bug Connected Kubernetes Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### Describe the bug

Escaping new lines in python strings in connectedk8s cli extension is producing large spaces in error messages. One of our test cases relies on matching the error messages and the space is breaking us.

One of likely many occurences is in the following file at line 398.
https://github.com/Azure/azure-cli-extensions/blob/83a18a57c034f2e350e2c53bc46afc1909d3cfc2/src/connectedk8s/azext_connectedk8s/custom.py

### Related command

Running `az connectedk8s create` pointing to a k8s cluster that's already been connected. This issue likely appears many times in connectedk8s output, and maybe other extensions if they are following a similar pattern trying to shorten code line length.

### Errors

The kubernetes cluster you are trying to onboard is already onboarded to                 the resource group 'rg' with resource name                     'cluster'.

### Issue script & Debug output

Not necessary

### Expected behavior

Don't want to see the extra space in output

### Environment Summary

az --version
azure-cli 2.55.0 *

core 2.55.0 *
telemetry 1.1.0

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\logangeorge\.azure\cliextensions'

Python (Windows) 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)]

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.