Skip to content

Commit

Permalink
Loosen the manual server shell compatibility check to allow for shell…
Browse files Browse the repository at this point in the history
… 8.0.38 built for 8.0.39 (#556)

* Loosen the manual server shell compatibility check to allow for shell 8.0.38 built for 8.0.39

* Fix failing unit test
  • Loading branch information
shayancanonical authored Nov 27, 2024
1 parent a235a99 commit b2d09cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/charms/mysql/v0/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def wait_until_mysql_connection(self) -> None:
# Increment this major API version when introducing breaking changes
LIBAPI = 0

LIBPATCH = 76
LIBPATCH = 77

UNIT_TEARDOWN_LOCKNAME = "unit-teardown"
UNIT_ADD_LOCKNAME = "unit-add"
Expand Down Expand Up @@ -2311,7 +2311,7 @@ def verify_server_upgradable(self, instance: Optional[str] = None) -> None:
"try:",
" util.check_for_server_upgrade(options={'outputFormat': 'JSON'})",
"except ValueError:", # ValueError is raised for same version check
" if session.run_sql('select @@version').fetch_all()[0][0].split('-')[0] == shell.version.split()[1]:",
" if session.run_sql('select @@version').fetch_all()[0][0].split('-')[0] in shell.version:",
" print('SAME_VERSION')",
" else:",
" raise",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ def test_verify_server_upgradable(self, _run_mysqlsh_script):
"shell.connect('clusteradmin:[email protected]:3306')",
"try:\n util.check_for_server_upgrade(options={'outputFormat': 'JSON'})",
"except ValueError:",
" if session.run_sql('select @@version').fetch_all()[0][0].split('-')[0] == shell.version.split()[1]:",
" if session.run_sql('select @@version').fetch_all()[0][0].split('-')[0] in shell.version:",
" print('SAME_VERSION')",
" else:",
" raise",
Expand Down

0 comments on commit b2d09cb

Please sign in to comment.