canonical / mysql-operator

Machine charm for MySQL following the operator framework
https://charmhub.io/mysql
Apache License 2.0
7 stars 10 forks source link

strip info line when present #294

Closed paulomach closed 1 year ago

paulomach commented 1 year ago

Issue

When reconnecting, util.check_for_server_upgrade outputs an info line before the json payload like:

Reconnecting to ...
{
  "expected":"json-payload"
...

which breaks json.loads call.

Solution

Strip info line when present (i.e. first line not starting with {)

codecov[bot] commented 1 year ago

Codecov Report

Merging #294 (1d4ada3) into main (e7c0e1f) will increase coverage by 0.05%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #294      +/-   ##
==========================================
+ Coverage   62.36%   62.41%   +0.05%     
==========================================
  Files          14       14              
  Lines        2686     2690       +4     
  Branches      344      345       +1     
==========================================
+ Hits         1675     1679       +4     
  Misses        903      903              
  Partials      108      108              
Files Changed Coverage Δ
lib/charms/mysql/v0/mysql.py 70.17% <100.00%> (+0.14%) :arrow_up: