Skip to content

Fixing that the suffix can be empty as well (needed for mysql-connector > 8)#337

Merged
bastelfreak merged 1 commit intovoxpupuli:masterfrom
diLLec:master
Feb 1, 2021
Merged

Fixing that the suffix can be empty as well (needed for mysql-connector > 8)#337
bastelfreak merged 1 commit intovoxpupuli:masterfrom
diLLec:master

Conversation

@diLLec
Copy link
Copy Markdown
Contributor

@diLLec diLLec commented Jan 19, 2021

Pull Request (PR) description

The change is needed to specificy and use a mysql-connector version > 8. The problem with those connectors is, that there is no "-bin" suffix in the jarfile and therefore the suffix needs to be empty. As the current String will require the string to be at least 1 character long, a version 8 connector can not be configured.

class {'jira':
...
    mysql_connector_manage       => true,
    mysql_connector_version      => '8.0.23',
    mysql_connector_install      => '/opt/MySQL-connector',
    mysql_connector_url          => 'https://dev.mysql.com/get/Downloads/Connector-J',
    mysql_connector_jar_suffix   => '', # no '-bin'!
...

results in
Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Class[Jira]: parameter 'mysql_connector_jar_suffix' expects a String[1, default]

This Pull Request (PR) fixes the following issues

Enables the useage of mysql-connector version > 8

Comment thread manifests/init.pp Outdated
Stdlib::Absolutepath $mysql_connector_install = '/opt/MySQL-connector',
Stdlib::HTTPUrl $mysql_connector_url = 'https://dev.mysql.com/get/Downloads/Connector-J',
String[1] $mysql_connector_jar_suffix = '-bin',
String $mysql_connector_jar_suffix = '-bin',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add a test for this that ensures it works with an empty string? Otherwise people might readd String[1] in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved and tests added - please see comment below

@diLLec
Copy link
Copy Markdown
Contributor Author

diLLec commented Feb 1, 2021

While working on the patch I've seen, that there already is version handlig code in the project (install.pp for example). Following that example I've put deleted the "suffix" variable and added logic that will change the filename scheme of the mysql connector jar based on the version.

@bastelfreak please review.

@bastelfreak bastelfreak added bug Something isn't working and removed needs-tests labels Feb 1, 2021
@bastelfreak
Copy link
Copy Markdown
Member

thanks for the update!

@bastelfreak bastelfreak merged commit 540c609 into voxpupuli:master Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants