mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-24 03:11:25 -07:00
Refactor to handle Unknown in the if block
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
parent
0a51d94137
commit
931f32cac6
1 changed files with 3 additions and 2 deletions
|
@ -70,11 +70,12 @@ def get_driver_version(mysql_driver):
|
|||
# - VERSION that returns the tupple (0, 7, 11, None)
|
||||
v = mysql_driver.VERSION[:3]
|
||||
return '.'.join(map(str, v))
|
||||
|
||||
if driver_name == 'MySQLdb':
|
||||
elif driver_name == 'MySQLdb':
|
||||
# version_info returns the tuple (2, 1, 1, 'final', 0)
|
||||
v = mysql_driver.version_info[:3]
|
||||
return '.'.join(map(str, v))
|
||||
else:
|
||||
return 'Unknown'
|
||||
|
||||
|
||||
def parse_from_mysql_config_file(cnf):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue